diff options
Diffstat (limited to 'src/test/ui/lint/let_underscore')
4 files changed, 0 insertions, 63 deletions
diff --git a/src/test/ui/lint/let_underscore/let_underscore_drop.rs b/src/test/ui/lint/let_underscore/let_underscore_drop.rs deleted file mode 100644 index f298871f1..000000000 --- a/src/test/ui/lint/let_underscore/let_underscore_drop.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass -#![warn(let_underscore_drop)] - -struct NontrivialDrop; - -impl Drop for NontrivialDrop { - fn drop(&mut self) { - println!("Dropping!"); - } -} - -fn main() { - let _ = NontrivialDrop; //~WARNING non-binding let on a type that implements `Drop` -} diff --git a/src/test/ui/lint/let_underscore/let_underscore_drop.stderr b/src/test/ui/lint/let_underscore/let_underscore_drop.stderr deleted file mode 100644 index 7b7de202e..000000000 --- a/src/test/ui/lint/let_underscore/let_underscore_drop.stderr +++ /dev/null @@ -1,22 +0,0 @@ -warning: non-binding let on a type that implements `Drop` - --> $DIR/let_underscore_drop.rs:13:5 - | -LL | let _ = NontrivialDrop; - | ^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/let_underscore_drop.rs:2:9 - | -LL | #![warn(let_underscore_drop)] - | ^^^^^^^^^^^^^^^^^^^ -help: consider binding to an unused variable to avoid immediately dropping the value - | -LL | let _unused = NontrivialDrop; - | ~~~~~~~ -help: consider immediately dropping the value - | -LL | drop(NontrivialDrop); - | ~~~~~ + - -warning: 1 warning emitted - diff --git a/src/test/ui/lint/let_underscore/let_underscore_lock.rs b/src/test/ui/lint/let_underscore/let_underscore_lock.rs deleted file mode 100644 index 7423862cd..000000000 --- a/src/test/ui/lint/let_underscore/let_underscore_lock.rs +++ /dev/null @@ -1,7 +0,0 @@ -// check-fail -use std::sync::{Arc, Mutex}; - -fn main() { - let data = Arc::new(Mutex::new(0)); - let _ = data.lock().unwrap(); //~ERROR non-binding let on a synchronization lock -} diff --git a/src/test/ui/lint/let_underscore/let_underscore_lock.stderr b/src/test/ui/lint/let_underscore/let_underscore_lock.stderr deleted file mode 100644 index fb58af0a4..000000000 --- a/src/test/ui/lint/let_underscore/let_underscore_lock.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: non-binding let on a synchronization lock - --> $DIR/let_underscore_lock.rs:6:9 - | -LL | let _ = data.lock().unwrap(); - | ^ ^^^^^^^^^^^^^^^^^^^^ this binding will immediately drop the value assigned to it - | | - | this lock is not assigned to a binding and is immediately dropped - | - = note: `#[deny(let_underscore_lock)]` on by default -help: consider binding to an unused variable to avoid immediately dropping the value - | -LL | let _unused = data.lock().unwrap(); - | ~~~~~~~ -help: consider immediately dropping the value - | -LL | drop(data.lock().unwrap()); - | ~~~~~ + - -error: aborting due to previous error - |