diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/ui/lint/dropping_copy_types.stderr | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/lint/dropping_copy_types.stderr')
-rw-r--r-- | tests/ui/lint/dropping_copy_types.stderr | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/tests/ui/lint/dropping_copy_types.stderr b/tests/ui/lint/dropping_copy_types.stderr new file mode 100644 index 000000000..b6291aa5e --- /dev/null +++ b/tests/ui/lint/dropping_copy_types.stderr @@ -0,0 +1,108 @@ +warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing + --> $DIR/dropping_copy_types.rs:34:5 + | +LL | drop(s1); + | ^^^^^--^ + | | + | argument has type `SomeStruct` + | + = note: use `let _ = ...` to ignore the expression or result +note: the lint level is defined here + --> $DIR/dropping_copy_types.rs:3:9 + | +LL | #![warn(dropping_copy_types)] + | ^^^^^^^^^^^^^^^^^^^ + +warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing + --> $DIR/dropping_copy_types.rs:35:5 + | +LL | drop(s2); + | ^^^^^--^ + | | + | argument has type `SomeStruct` + | + = note: use `let _ = ...` to ignore the expression or result + +warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing + --> $DIR/dropping_copy_types.rs:36:5 + | +LL | drop(s3); + | ^^^^^--^ + | | + | argument has type `&SomeStruct` + | + = note: use `let _ = ...` to ignore the expression or result + = note: `#[warn(dropping_references)]` on by default + +warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing + --> $DIR/dropping_copy_types.rs:37:5 + | +LL | drop(s4); + | ^^^^^--^ + | | + | argument has type `SomeStruct` + | + = note: use `let _ = ...` to ignore the expression or result + +warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing + --> $DIR/dropping_copy_types.rs:38:5 + | +LL | drop(s5); + | ^^^^^--^ + | | + | argument has type `&SomeStruct` + | + = note: use `let _ = ...` to ignore the expression or result + +warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing + --> $DIR/dropping_copy_types.rs:50:5 + | +LL | drop(a2); + | ^^^^^--^ + | | + | argument has type `&AnotherStruct` + | + = note: use `let _ = ...` to ignore the expression or result + +warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing + --> $DIR/dropping_copy_types.rs:52:5 + | +LL | drop(a4); + | ^^^^^--^ + | | + | argument has type `&AnotherStruct` + | + = note: use `let _ = ...` to ignore the expression or result + +warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing + --> $DIR/dropping_copy_types.rs:71:13 + | +LL | drop(println_and(13)); + | ^^^^^---------------^ + | | + | argument has type `i32` + | + = note: use `let _ = ...` to ignore the expression or result + +warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing + --> $DIR/dropping_copy_types.rs:74:14 + | +LL | 3 if drop(println_and(14)) == () => (), + | ^^^^^---------------^ + | | + | argument has type `i32` + | + = note: use `let _ = ...` to ignore the expression or result + +warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing + --> $DIR/dropping_copy_types.rs:76:14 + | +LL | 4 => drop(2), + | ^^^^^-^ + | | + | argument has type `i32` + | + = note: use `let _ = ...` to ignore the expression or result + +warning: 10 warnings emitted + |