Adjust error message grammar to be less awkward
This commit is contained in:
parent
30017c36d6
commit
65d329d189
14 changed files with 61 additions and 61 deletions
|
|
@ -518,7 +518,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
|
|||
.with_span_help(
|
||||
self.get_closure_bound_clause_span(*def_id),
|
||||
"`Fn` and `FnMut` closures require captured values to be able to be \
|
||||
consumed multiple times, but an `FnOnce` consume them only once",
|
||||
consumed multiple times, but `FnOnce` closures may consume them only once",
|
||||
)
|
||||
}
|
||||
_ => {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ LL | Box::new(|| x)
|
|||
| |
|
||||
| captured by this `Fn` closure
|
||||
|
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | Box::new(|| x.clone())
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ LL | let _h = to_fn_once(move || -> isize { *bar });
|
|||
| |
|
||||
| `bar` is moved here
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/borrowck-move-by-capture.rs:3:37
|
||||
|
|
||||
LL | fn to_fn_mut<A:std::marker::Tuple,F:FnMut<A>>(f: F) -> F { f }
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ LL |
|
|||
LL | self.b;
|
||||
| ^^^^^^ `self.b` is moved here
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/issue-103624.rs:7:36
|
||||
|
|
||||
LL | async fn spawn_blocking<T>(f: impl (Fn() -> T) + Send + Sync + 'static) -> T {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ LL |
|
|||
LL | let _foo: String = val;
|
||||
| ^^^ move occurs because `val` has type `String`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/issue-87456-point-to-closure.rs:3:24
|
||||
|
|
||||
LL | fn take_mut(_val: impl FnMut()) {}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ LL | y.into_iter();
|
|||
| |
|
||||
| move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:5:28
|
||||
|
|
||||
LL | fn call<F>(f: F) where F : Fn() {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ LL | id(Box::new(|| *v))
|
|||
| |
|
||||
| captured by this `FnMut` closure
|
||||
|
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
help: if `T` implemented `Clone`, you could clone the value
|
||||
--> $DIR/issue-4335.rs:5:10
|
||||
|
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ LL | let _f = to_fn(|| test(i));
|
|||
| |
|
||||
| captured by this `Fn` closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:3:33
|
||||
|
|
||||
LL | fn to_fn<A:std::marker::Tuple,F:Fn<A>>(f: F) -> F { f }
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ LL | expect_fn(|| drop(x.0));
|
|||
| |
|
||||
| captured by this `Fn` closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/issue-52663-span-decl-captured-variable.rs:1:33
|
||||
|
|
||||
LL | fn expect_fn<F>(f: F) where F : Fn() {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ LL |
|
|||
LL | foo(f);
|
||||
| ^ 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
|
||||
|
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
help: consider cloning the value if the performance cost is acceptable
|
||||
|
|
||||
LL | foo(f.clone());
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ LL | let X(_t) = x;
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -37,7 +37,7 @@ LL | if let Either::One(_t) = e { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -62,7 +62,7 @@ LL | while let Either::One(_t) = e { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -90,7 +90,7 @@ LL | Either::One(_t)
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -118,7 +118,7 @@ LL | Either::One(_t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -143,7 +143,7 @@ LL | let X(mut _t) = x;
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -168,7 +168,7 @@ LL | if let Either::One(mut _t) = em { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -193,7 +193,7 @@ LL | while let Either::One(mut _t) = em { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -221,7 +221,7 @@ LL | Either::One(mut _t)
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -249,7 +249,7 @@ LL | Either::One(mut _t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:13:18
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -273,7 +273,7 @@ LL | let X(_t) = x;
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -298,7 +298,7 @@ LL | if let Either::One(_t) = e { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -323,7 +323,7 @@ LL | while let Either::One(_t) = e { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -351,7 +351,7 @@ LL | Either::One(_t)
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -379,7 +379,7 @@ LL | Either::One(_t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -404,7 +404,7 @@ LL | let X(mut _t) = x;
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -429,7 +429,7 @@ LL | if let Either::One(mut _t) = em { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -454,7 +454,7 @@ LL | while let Either::One(mut _t) = em { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -482,7 +482,7 @@ LL | Either::One(mut _t)
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -510,7 +510,7 @@ LL | Either::One(mut _t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:39:22
|
||||
|
|
||||
LL | fn consume_fn<F: Fn()>(_f: F) { }
|
||||
|
|
@ -534,7 +534,7 @@ LL | let X(_t) = x;
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -559,7 +559,7 @@ LL | if let Either::One(_t) = e { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -584,7 +584,7 @@ LL | while let Either::One(_t) = e { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -612,7 +612,7 @@ LL | Either::One(_t)
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -640,7 +640,7 @@ LL | Either::One(_t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -665,7 +665,7 @@ LL | let X(mut _t) = x;
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -690,7 +690,7 @@ LL | if let Either::One(mut _t) = em { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -715,7 +715,7 @@ LL | while let Either::One(mut _t) = em { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -743,7 +743,7 @@ LL | Either::One(mut _t)
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -771,7 +771,7 @@ LL | Either::One(mut _t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:50:29
|
||||
|
|
||||
LL | fn method_consume_fn<F: Fn()>(&self, _f: F) { }
|
||||
|
|
@ -795,7 +795,7 @@ LL | let X(_t) = x;
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -820,7 +820,7 @@ LL | if let Either::One(_t) = e { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -845,7 +845,7 @@ LL | while let Either::One(_t) = e { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -873,7 +873,7 @@ LL | Either::One(_t)
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -901,7 +901,7 @@ LL | Either::One(_t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -926,7 +926,7 @@ LL | let X(mut _t) = x;
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -951,7 +951,7 @@ LL | if let Either::One(mut _t) = em { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -976,7 +976,7 @@ LL | while let Either::One(mut _t) = em { }
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -1004,7 +1004,7 @@ LL | Either::One(mut _t)
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -1032,7 +1032,7 @@ LL | Either::One(mut _t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
@ -1060,7 +1060,7 @@ LL | Either::One(mut _t) => (),
|
|||
| data moved here
|
||||
| move occurs because `_t` has type `X`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/move-into-closure.rs:25:21
|
||||
|
|
||||
LL | fn consume_fnmut<F: FnMut()>(_f: F) { }
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ LL |
|
|||
LL | var = Some(NotCopyable);
|
||||
| --- variable moved due to use in closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/option-content-move2.rs:5:12
|
||||
|
|
||||
LL | fn func<F: FnMut() -> H, H: FnMut()>(_: F) {}
|
||||
|
|
@ -44,7 +44,7 @@ LL |
|
|||
LL | var = Some(NotCopyableButCloneable);
|
||||
| --- variable moved due to use in closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/option-content-move2.rs:5:12
|
||||
|
|
||||
LL | fn func<F: FnMut() -> H, H: FnMut()>(_: F) {}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ LL | move || {
|
|||
LL | let x = var;
|
||||
| ^^^ move occurs because `var` has type `NotCopyable`, which does not implement the `Copy` trait
|
||||
|
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
note: if `NotCopyable` implemented `Clone`, you could clone the value
|
||||
--> $DIR/option-content-move3.rs:2:1
|
||||
|
|
||||
|
|
@ -38,7 +38,7 @@ LL | move || {
|
|||
LL | let x = var;
|
||||
| --- variable moved due to use in closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/option-content-move3.rs:6:12
|
||||
|
|
||||
LL | fn func<F: FnMut() -> H, H: FnMut()>(_: F) {}
|
||||
|
|
@ -63,7 +63,7 @@ LL | move || {
|
|||
LL | let x = var;
|
||||
| ^^^ move occurs because `var` has type `NotCopyableButCloneable`, which does not implement the `Copy` trait
|
||||
|
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
= help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
help: consider borrowing here
|
||||
|
|
||||
LL | let x = &var;
|
||||
|
|
@ -84,7 +84,7 @@ LL | move || {
|
|||
LL | let x = var;
|
||||
| --- variable moved due to use in closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/option-content-move3.rs:6:12
|
||||
|
|
||||
LL | fn func<F: FnMut() -> H, H: FnMut()>(_: F) {}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ LL | let f = to_fn(|| drop(x));
|
|||
| |
|
||||
| captured by this `Fn` closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/unboxed-closure-illegal-move.rs:7:33
|
||||
|
|
||||
LL | fn to_fn<A:std::marker::Tuple,F:Fn<A>>(f: F) -> F { f }
|
||||
|
|
@ -32,7 +32,7 @@ LL | let f = to_fn_mut(|| drop(x));
|
|||
| |
|
||||
| captured by this `FnMut` closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/unboxed-closure-illegal-move.rs:8:37
|
||||
|
|
||||
LL | fn to_fn_mut<A:std::marker::Tuple,F:FnMut<A>>(f: F) -> F { f }
|
||||
|
|
@ -54,7 +54,7 @@ LL | let f = to_fn(move || drop(x));
|
|||
| |
|
||||
| captured by this `Fn` closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/unboxed-closure-illegal-move.rs:7:33
|
||||
|
|
||||
LL | fn to_fn<A:std::marker::Tuple,F:Fn<A>>(f: F) -> F { f }
|
||||
|
|
@ -72,7 +72,7 @@ LL | let f = to_fn_mut(move || drop(x));
|
|||
| |
|
||||
| captured by this `FnMut` closure
|
||||
|
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but an `FnOnce` consume them only once
|
||||
help: `Fn` and `FnMut` closures require captured values to be able to be consumed multiple times, but `FnOnce` closures may consume them only once
|
||||
--> $DIR/unboxed-closure-illegal-move.rs:8:37
|
||||
|
|
||||
LL | fn to_fn_mut<A:std::marker::Tuple,F:FnMut<A>>(f: F) -> F { f }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue