Fix wording
This commit is contained in:
parent
d687d46f68
commit
e6e7a6db28
@ -403,7 +403,7 @@ fn visit_pat(&mut self, p: &'hir hir::Pat<'hir>) {
|
|||||||
let mut span: MultiSpan = arg.span.into();
|
let mut span: MultiSpan = arg.span.into();
|
||||||
span.push_span_label(
|
span.push_span_label(
|
||||||
arg.span,
|
arg.span,
|
||||||
"this type parameter takes ownership of the value".to_string(),
|
"this parameter takes ownership of the value".to_string(),
|
||||||
);
|
);
|
||||||
let descr = match node.fn_kind() {
|
let descr = match node.fn_kind() {
|
||||||
Some(hir::intravisit::FnKind::ItemFn(..)) | None => "function",
|
Some(hir::intravisit::FnKind::ItemFn(..)) | None => "function",
|
||||||
|
@ -12,7 +12,7 @@ note: consider changing this parameter type in function `consume` to borrow inst
|
|||||||
--> $DIR/borrowck-consume-unsize-vec.rs:3:15
|
--> $DIR/borrowck-consume-unsize-vec.rs:3:15
|
||||||
|
|
|
|
||||||
LL | fn consume(_: Box<[i32]>) {
|
LL | fn consume(_: Box<[i32]>) {
|
||||||
| ------- ^^^^^^^^^^ this type parameter takes ownership of the value
|
| ------- ^^^^^^^^^^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider cloning the value if the performance cost is acceptable
|
help: consider cloning the value if the performance cost is acceptable
|
||||||
|
@ -12,7 +12,7 @@ note: consider changing this parameter type in function `consume` to borrow inst
|
|||||||
--> $DIR/borrowck-consume-upcast-box.rs:5:15
|
--> $DIR/borrowck-consume-upcast-box.rs:5:15
|
||||||
|
|
|
|
||||||
LL | fn consume(_: Box<dyn Foo>) {
|
LL | fn consume(_: Box<dyn Foo>) {
|
||||||
| ------- ^^^^^^^^^^^^ this type parameter takes ownership of the value
|
| ------- ^^^^^^^^^^^^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ note: consider changing this parameter type in function `handle` to borrow inste
|
|||||||
--> $DIR/mut-borrow-in-loop-2.rs:9:22
|
--> $DIR/mut-borrow-in-loop-2.rs:9:22
|
||||||
|
|
|
|
||||||
LL | fn handle(value: T) -> Self;
|
LL | fn handle(value: T) -> Self;
|
||||||
| ------ ^ this type parameter takes ownership of the value
|
| ------ ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider creating a fresh reborrow of `value` here
|
help: consider creating a fresh reborrow of `value` here
|
||||||
|
@ -13,7 +13,7 @@ note: consider changing this parameter type in function `take` to borrow instead
|
|||||||
--> $DIR/liveness-move-call-arg.rs:1:13
|
--> $DIR/liveness-move-call-arg.rs:1:13
|
||||||
|
|
|
|
||||||
LL | fn take(_x: Box<isize>) {}
|
LL | fn take(_x: Box<isize>) {}
|
||||||
| ---- ^^^^^^^^^^ this type parameter takes ownership of the value
|
| ---- ^^^^^^^^^^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider cloning the value if the performance cost is acceptable
|
help: consider cloning the value if the performance cost is acceptable
|
||||||
|
@ -12,7 +12,7 @@ note: consider changing this parameter type in function `send` to borrow instead
|
|||||||
--> $DIR/liveness-use-after-send.rs:3:54
|
--> $DIR/liveness-use-after-send.rs:3:54
|
||||||
|
|
|
|
||||||
LL | fn send<T:Send + std::fmt::Debug>(ch: Chan<T>, data: T) {
|
LL | fn send<T:Send + std::fmt::Debug>(ch: Chan<T>, data: T) {
|
||||||
| ---- in this function ^ this type parameter takes ownership of the value
|
| ---- in this function ^ this parameter takes ownership of the value
|
||||||
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
help: consider cloning the value if the performance cost is acceptable
|
help: consider cloning the value if the performance cost is acceptable
|
||||||
|
|
|
|
||||||
|
@ -12,7 +12,7 @@ note: consider changing this parameter type in function `takes_fnonce` to borrow
|
|||||||
--> $DIR/borrow-closures-instead-of-move.rs:34:20
|
--> $DIR/borrow-closures-instead-of-move.rs:34:20
|
||||||
|
|
|
|
||||||
LL | fn takes_fnonce(_: impl FnOnce()) {}
|
LL | fn takes_fnonce(_: impl FnOnce()) {}
|
||||||
| ------------ ^^^^^^^^^^^^^ this type parameter takes ownership of the value
|
| ------------ ^^^^^^^^^^^^^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider borrowing `f`
|
help: consider borrowing `f`
|
||||||
@ -36,7 +36,7 @@ note: consider changing this parameter type in function `takes_fnonce` to borrow
|
|||||||
--> $DIR/borrow-closures-instead-of-move.rs:34:20
|
--> $DIR/borrow-closures-instead-of-move.rs:34:20
|
||||||
|
|
|
|
||||||
LL | fn takes_fnonce(_: impl FnOnce()) {}
|
LL | fn takes_fnonce(_: impl FnOnce()) {}
|
||||||
| ------------ ^^^^^^^^^^^^^ this type parameter takes ownership of the value
|
| ------------ ^^^^^^^^^^^^^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider mutably borrowing `m`
|
help: consider mutably borrowing `m`
|
||||||
@ -62,7 +62,7 @@ note: consider changing this parameter type in function `takes_fnonce` to borrow
|
|||||||
--> $DIR/borrow-closures-instead-of-move.rs:34:20
|
--> $DIR/borrow-closures-instead-of-move.rs:34:20
|
||||||
|
|
|
|
||||||
LL | fn takes_fnonce(_: impl FnOnce()) {}
|
LL | fn takes_fnonce(_: impl FnOnce()) {}
|
||||||
| ------------ ^^^^^^^^^^^^^ this type parameter takes ownership of the value
|
| ------------ ^^^^^^^^^^^^^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider mutably borrowing `closure`
|
help: consider mutably borrowing `closure`
|
||||||
|
@ -13,7 +13,7 @@ note: consider changing this parameter type in function `take` to borrow instead
|
|||||||
--> $DIR/move-guard-same-consts.rs:25:15
|
--> $DIR/move-guard-same-consts.rs:25:15
|
||||||
|
|
|
|
||||||
LL | fn take<T>(_: T) -> bool { false }
|
LL | fn take<T>(_: T) -> bool { false }
|
||||||
| ---- ^ this type parameter takes ownership of the value
|
| ---- ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider cloning the value if the performance cost is acceptable
|
help: consider cloning the value if the performance cost is acceptable
|
||||||
|
@ -13,7 +13,7 @@ note: consider changing this parameter type in function `take` to borrow instead
|
|||||||
--> $DIR/move-in-guard-1.rs:15:15
|
--> $DIR/move-in-guard-1.rs:15:15
|
||||||
|
|
|
|
||||||
LL | fn take<T>(_: T) -> bool { false }
|
LL | fn take<T>(_: T) -> bool { false }
|
||||||
| ---- ^ this type parameter takes ownership of the value
|
| ---- ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider cloning the value if the performance cost is acceptable
|
help: consider cloning the value if the performance cost is acceptable
|
||||||
|
@ -11,7 +11,7 @@ note: consider changing this parameter type in function `take` to borrow instead
|
|||||||
--> $DIR/move-in-guard-2.rs:13:15
|
--> $DIR/move-in-guard-2.rs:13:15
|
||||||
|
|
|
|
||||||
LL | fn take<T>(_: T) -> bool { false }
|
LL | fn take<T>(_: T) -> bool { false }
|
||||||
| ---- ^ this type parameter takes ownership of the value
|
| ---- ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider cloning the value if the performance cost is acceptable
|
help: consider cloning the value if the performance cost is acceptable
|
||||||
|
@ -112,7 +112,7 @@ note: consider changing this parameter type in function `guard` to borrow instea
|
|||||||
--> $DIR/moves-based-on-type-exprs.rs:6:14
|
--> $DIR/moves-based-on-type-exprs.rs:6:14
|
||||||
|
|
|
|
||||||
LL | fn guard(_s: String) -> bool {panic!()}
|
LL | fn guard(_s: String) -> bool {panic!()}
|
||||||
| ----- ^^^^^^ this type parameter takes ownership of the value
|
| ----- ^^^^^^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
help: consider cloning the value if the performance cost is acceptable
|
help: consider cloning the value if the performance cost is acceptable
|
||||||
|
@ -13,7 +13,7 @@ note: consider changing this parameter type in function `move_out` to borrow ins
|
|||||||
--> $DIR/union-move.rs:10:19
|
--> $DIR/union-move.rs:10:19
|
||||||
|
|
|
|
||||||
LL | fn move_out<T>(x: T) {}
|
LL | fn move_out<T>(x: T) {}
|
||||||
| -------- ^ this type parameter takes ownership of the value
|
| -------- ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ note: consider changing this parameter type in function `move_out` to borrow ins
|
|||||||
--> $DIR/union-move.rs:10:19
|
--> $DIR/union-move.rs:10:19
|
||||||
|
|
|
|
||||||
LL | fn move_out<T>(x: T) {}
|
LL | fn move_out<T>(x: T) {}
|
||||||
| -------- ^ this type parameter takes ownership of the value
|
| -------- ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ note: consider changing this parameter type in function `move_out` to borrow ins
|
|||||||
--> $DIR/union-move.rs:10:19
|
--> $DIR/union-move.rs:10:19
|
||||||
|
|
|
|
||||||
LL | fn move_out<T>(x: T) {}
|
LL | fn move_out<T>(x: T) {}
|
||||||
| -------- ^ this type parameter takes ownership of the value
|
| -------- ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ note: consider changing this parameter type in function `move_out` to borrow ins
|
|||||||
--> $DIR/union-move.rs:10:19
|
--> $DIR/union-move.rs:10:19
|
||||||
|
|
|
|
||||||
LL | fn move_out<T>(x: T) {}
|
LL | fn move_out<T>(x: T) {}
|
||||||
| -------- ^ this type parameter takes ownership of the value
|
| -------- ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ note: consider changing this parameter type in function `drop_unsized` to borrow
|
|||||||
--> $DIR/borrow-after-move.rs:14:31
|
--> $DIR/borrow-after-move.rs:14:31
|
||||||
|
|
|
|
||||||
LL | fn drop_unsized<T: ?Sized>(_: T) {}
|
LL | fn drop_unsized<T: ?Sized>(_: T) {}
|
||||||
| ------------ ^ this type parameter takes ownership of the value
|
| ------------ ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ note: consider changing this parameter type in function `drop_unsized` to borrow
|
|||||||
--> $DIR/double-move.rs:14:31
|
--> $DIR/double-move.rs:14:31
|
||||||
|
|
|
|
||||||
LL | fn drop_unsized<T: ?Sized>(_: T) {}
|
LL | fn drop_unsized<T: ?Sized>(_: T) {}
|
||||||
| ------------ ^ this type parameter takes ownership of the value
|
| ------------ ^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this function
|
| in this function
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ note: consider changing this parameter type in method `push` to borrow instead i
|
|||||||
--> $DIR/use-after-move-implicity-coerced-object.rs:17:27
|
--> $DIR/use-after-move-implicity-coerced-object.rs:17:27
|
||||||
|
|
|
|
||||||
LL | fn push(&mut self, n: Box<dyn ToString + 'static>) {
|
LL | fn push(&mut self, n: Box<dyn ToString + 'static>) {
|
||||||
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this type parameter takes ownership of the value
|
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this parameter takes ownership of the value
|
||||||
| |
|
| |
|
||||||
| in this method
|
| in this method
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user