Skip to content

Commit 0698921

Browse files
authored
Rollup merge of #145403 - shepmaster:grammar, r=estebank
Adjust error message grammar to be less awkward r? ``@estebank``
2 parents 603ee15 + 65d329d commit 0698921

14 files changed

+61
-61
lines changed

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
518518
.with_span_help(
519519
self.get_closure_bound_clause_span(*def_id),
520520
"`Fn` and `FnMut` closures require captured values to be able to be \
521-
consumed multiple times, but an `FnOnce` consume them only once",
521+
consumed multiple times, but `FnOnce` closures may consume them only once",
522522
)
523523
}
524524
_ => {

tests/ui/borrowck/borrowck-in-static.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | Box::new(|| x)
1010
| |
1111
| captured by this `Fn` closure
1212
|
13-
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
13+
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1414
help: consider cloning the value if the performance cost is acceptable
1515
|
1616
LL | Box::new(|| x.clone())

tests/ui/borrowck/borrowck-move-by-capture.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | let _h = to_fn_once(move || -> isize { *bar });
1212
| |
1313
| `bar` is moved here
1414
|
15-
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
15+
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1616
--> $DIR/borrowck-move-by-capture.rs:3:37
1717
|
1818
LL | fn to_fn_mut<A:std::marker::Tuple,F:FnMut<A>>(f: F) -> F { f }

tests/ui/borrowck/issue-103624.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL |
1313
LL | self.b;
1414
| ^^^^^^ `self.b` is moved here
1515
|
16-
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
16+
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1717
--> $DIR/issue-103624.rs:7:36
1818
|
1919
LL | async fn spawn_blocking<T>(f: impl (Fn() -> T) + Send + Sync + 'static) -> T {

tests/ui/borrowck/issue-87456-point-to-closure.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL |
1010
LL | let _foo: String = val;
1111
| ^^^ move occurs because `val` has type `String`, which does not implement the `Copy` trait
1212
|
13-
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
13+
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1414
--> $DIR/issue-87456-point-to-closure.rs:3:24
1515
|
1616
LL | fn take_mut(_val: impl FnMut()) {}

tests/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | y.into_iter();
1010
| |
1111
| move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
1212
|
13-
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
13+
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1414
--> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:5:28
1515
|
1616
LL | fn call<F>(f: F) where F : Fn() {

tests/ui/issues/issue-4335.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | id(Box::new(|| *v))
1010
| |
1111
| captured by this `FnMut` closure
1212
|
13-
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
13+
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1414
help: if `T` implemented `Clone`, you could clone the value
1515
--> $DIR/issue-4335.rs:5:10
1616
|

tests/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | let _f = to_fn(|| test(i));
1010
| |
1111
| captured by this `Fn` closure
1212
|
13-
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
13+
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1414
--> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:3:33
1515
|
1616
LL | fn to_fn<A:std::marker::Tuple,F:Fn<A>>(f: F) -> F { f }

tests/ui/nll/issue-52663-span-decl-captured-variable.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | expect_fn(|| drop(x.0));
1010
| |
1111
| captured by this `Fn` closure
1212
|
13-
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
13+
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
1414
--> $DIR/issue-52663-span-decl-captured-variable.rs:1:33
1515
|
1616
LL | fn expect_fn<F>(f: F) where F : Fn() {

tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ LL |
4444
LL | foo(f);
4545
| ^ move occurs because `f` has type `{closure@$DIR/borrowck-call-is-borrow-issue-12224.rs:52:17: 52:58}`, which does not implement the `Copy` trait
4646
|
47-
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
47+
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
4848
help: consider cloning the value if the performance cost is acceptable
4949
|
5050
LL | foo(f.clone());

0 commit comments

Comments
 (0)