Improve warning message by saying that it "does nothing"
This commit is contained in:
parent
457fa953a2
commit
d23f8957ae
5 changed files with 43 additions and 43 deletions
|
@ -521,14 +521,14 @@ lint_opaque_hidden_inferred_bound = opaque type `{$ty}` does not satisfy its ass
|
|||
|
||||
lint_opaque_hidden_inferred_bound_sugg = add this bound
|
||||
|
||||
lint_drop_ref = calls to `std::mem::drop` with a reference instead of an owned value
|
||||
lint_drop_ref = calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
.label = argument has type `{$arg_ty}`
|
||||
|
||||
lint_drop_copy = calls to `std::mem::drop` with a value that implements `Copy`.
|
||||
lint_drop_copy = calls to `std::mem::drop` with a value that implements `Copy` does nothing
|
||||
.label = argument has type `{$arg_ty}`
|
||||
|
||||
lint_forget_ref = calls to `std::mem::forget` with a reference instead of an owned value
|
||||
lint_forget_ref = calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
.label = argument has type `{$arg_ty}`
|
||||
|
||||
lint_forget_copy = calls to `std::mem::forget` with a value that implements `Copy`.
|
||||
lint_forget_copy = calls to `std::mem::forget` with a value that implements `Copy` does nothing
|
||||
.label = argument has type `{$arg_ty}`
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
warning: calls to `std::mem::drop` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
|
||||
--> $DIR/drop_copy.rs:34:5
|
||||
|
|
||||
LL | drop(s1);
|
||||
|
@ -12,7 +12,7 @@ note: the lint level is defined here
|
|||
LL | #![warn(drop_copy)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
|
||||
--> $DIR/drop_copy.rs:35:5
|
||||
|
|
||||
LL | drop(s2);
|
||||
|
@ -20,7 +20,7 @@ LL | drop(s2);
|
|||
| |
|
||||
| argument has type `SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_copy.rs:36:5
|
||||
|
|
||||
LL | drop(s3);
|
||||
|
@ -30,7 +30,7 @@ LL | drop(s3);
|
|||
|
|
||||
= note: `#[warn(drop_ref)]` on by default
|
||||
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
|
||||
--> $DIR/drop_copy.rs:37:5
|
||||
|
|
||||
LL | drop(s4);
|
||||
|
@ -38,7 +38,7 @@ LL | drop(s4);
|
|||
| |
|
||||
| argument has type `SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_copy.rs:38:5
|
||||
|
|
||||
LL | drop(s5);
|
||||
|
@ -46,7 +46,7 @@ LL | drop(s5);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_copy.rs:50:5
|
||||
|
|
||||
LL | drop(a2);
|
||||
|
@ -54,7 +54,7 @@ LL | drop(a2);
|
|||
| |
|
||||
| argument has type `&AnotherStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_copy.rs:52:5
|
||||
|
|
||||
LL | drop(a4);
|
||||
|
@ -62,7 +62,7 @@ LL | drop(a4);
|
|||
| |
|
||||
| argument has type `&AnotherStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
|
||||
--> $DIR/drop_copy.rs:71:13
|
||||
|
|
||||
LL | drop(println_and(13));
|
||||
|
@ -70,7 +70,7 @@ LL | drop(println_and(13));
|
|||
| |
|
||||
| argument has type `i32`
|
||||
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
|
||||
--> $DIR/drop_copy.rs:74:14
|
||||
|
|
||||
LL | 3 if drop(println_and(14)) == () => (),
|
||||
|
@ -78,7 +78,7 @@ LL | 3 if drop(println_and(14)) == () => (),
|
|||
| |
|
||||
| argument has type `i32`
|
||||
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
|
||||
--> $DIR/drop_copy.rs:76:14
|
||||
|
|
||||
LL | 4 => drop(2),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:8:5
|
||||
|
|
||||
LL | drop(&SomeStruct);
|
||||
|
@ -12,7 +12,7 @@ note: the lint level is defined here
|
|||
LL | #![warn(drop_ref)]
|
||||
| ^^^^^^^^
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:11:5
|
||||
|
|
||||
LL | drop(&owned1);
|
||||
|
@ -20,7 +20,7 @@ LL | drop(&owned1);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:12:5
|
||||
|
|
||||
LL | drop(&&owned1);
|
||||
|
@ -28,7 +28,7 @@ LL | drop(&&owned1);
|
|||
| |
|
||||
| argument has type `&&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:13:5
|
||||
|
|
||||
LL | drop(&mut owned1);
|
||||
|
@ -36,7 +36,7 @@ LL | drop(&mut owned1);
|
|||
| |
|
||||
| argument has type `&mut SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:17:5
|
||||
|
|
||||
LL | drop(reference1);
|
||||
|
@ -44,7 +44,7 @@ LL | drop(reference1);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:20:5
|
||||
|
|
||||
LL | drop(reference2);
|
||||
|
@ -52,7 +52,7 @@ LL | drop(reference2);
|
|||
| |
|
||||
| argument has type `&mut SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:23:5
|
||||
|
|
||||
LL | drop(reference3);
|
||||
|
@ -60,7 +60,7 @@ LL | drop(reference3);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:28:5
|
||||
|
|
||||
LL | drop(&val);
|
||||
|
@ -68,7 +68,7 @@ LL | drop(&val);
|
|||
| |
|
||||
| argument has type `&T`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:36:5
|
||||
|
|
||||
LL | std::mem::drop(&SomeStruct);
|
||||
|
@ -76,7 +76,7 @@ LL | std::mem::drop(&SomeStruct);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:91:13
|
||||
|
|
||||
LL | drop(println_and(&13));
|
||||
|
@ -84,7 +84,7 @@ LL | drop(println_and(&13));
|
|||
| |
|
||||
| argument has type `&i32`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:94:14
|
||||
|
|
||||
LL | 3 if drop(println_and(&14)) == () => (),
|
||||
|
@ -92,7 +92,7 @@ LL | 3 if drop(println_and(&14)) == () => (),
|
|||
| |
|
||||
| argument has type `&i32`
|
||||
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
|
||||
--> $DIR/drop_ref.rs:96:14
|
||||
|
|
||||
LL | 4 => drop(&2),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
warning: calls to `std::mem::forget` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing
|
||||
--> $DIR/forget_copy.rs:34:5
|
||||
|
|
||||
LL | forget(s1);
|
||||
|
@ -12,7 +12,7 @@ note: the lint level is defined here
|
|||
LL | #![warn(forget_copy)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
warning: calls to `std::mem::forget` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing
|
||||
--> $DIR/forget_copy.rs:35:5
|
||||
|
|
||||
LL | forget(s2);
|
||||
|
@ -20,7 +20,7 @@ LL | forget(s2);
|
|||
| |
|
||||
| argument has type `SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_copy.rs:36:5
|
||||
|
|
||||
LL | forget(s3);
|
||||
|
@ -30,7 +30,7 @@ LL | forget(s3);
|
|||
|
|
||||
= note: `#[warn(forget_ref)]` on by default
|
||||
|
||||
warning: calls to `std::mem::forget` with a value that implements `Copy`.
|
||||
warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing
|
||||
--> $DIR/forget_copy.rs:37:5
|
||||
|
|
||||
LL | forget(s4);
|
||||
|
@ -38,7 +38,7 @@ LL | forget(s4);
|
|||
| |
|
||||
| argument has type `SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_copy.rs:38:5
|
||||
|
|
||||
LL | forget(s5);
|
||||
|
@ -46,7 +46,7 @@ LL | forget(s5);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_copy.rs:50:5
|
||||
|
|
||||
LL | forget(a2);
|
||||
|
@ -54,7 +54,7 @@ LL | forget(a2);
|
|||
| |
|
||||
| argument has type `&AnotherStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_copy.rs:52:5
|
||||
|
|
||||
LL | forget(a3);
|
||||
|
@ -62,7 +62,7 @@ LL | forget(a3);
|
|||
| |
|
||||
| argument has type `&AnotherStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_copy.rs:53:5
|
||||
|
|
||||
LL | forget(a4);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:10:5
|
||||
|
|
||||
LL | forget(&SomeStruct);
|
||||
|
@ -12,7 +12,7 @@ note: the lint level is defined here
|
|||
LL | #![warn(forget_ref)]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:13:5
|
||||
|
|
||||
LL | forget(&owned);
|
||||
|
@ -20,7 +20,7 @@ LL | forget(&owned);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:14:5
|
||||
|
|
||||
LL | forget(&&owned);
|
||||
|
@ -28,7 +28,7 @@ LL | forget(&&owned);
|
|||
| |
|
||||
| argument has type `&&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:15:5
|
||||
|
|
||||
LL | forget(&mut owned);
|
||||
|
@ -36,7 +36,7 @@ LL | forget(&mut owned);
|
|||
| |
|
||||
| argument has type `&mut SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:19:5
|
||||
|
|
||||
LL | forget(&*reference1);
|
||||
|
@ -44,7 +44,7 @@ LL | forget(&*reference1);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:22:5
|
||||
|
|
||||
LL | forget(reference2);
|
||||
|
@ -52,7 +52,7 @@ LL | forget(reference2);
|
|||
| |
|
||||
| argument has type `&mut SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:25:5
|
||||
|
|
||||
LL | forget(reference3);
|
||||
|
@ -60,7 +60,7 @@ LL | forget(reference3);
|
|||
| |
|
||||
| argument has type `&SomeStruct`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:30:5
|
||||
|
|
||||
LL | forget(&val);
|
||||
|
@ -68,7 +68,7 @@ LL | forget(&val);
|
|||
| |
|
||||
| argument has type `&T`
|
||||
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value
|
||||
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
|
||||
--> $DIR/forget_ref.rs:38:5
|
||||
|
|
||||
LL | std::mem::forget(&SomeStruct);
|
||||
|
|
Loading…
Add table
Reference in a new issue