+++ /dev/null
-// run-pass
-// compile-flags: -W 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`
-}
+++ /dev/null
-warning: non-binding let on a type that implements `Drop`
- --> $DIR/let_underscore_drop.rs:13:5
- |
-LL | let _ = NontrivialDrop;
- | ^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: requested on the command line with `-W let-underscore-drop`
-help: consider binding to an unused variable
- |
-LL | let _unused = NontrivialDrop;
- | ~~~~~~~
-help: consider explicitly droping with `std::mem::drop`
- |
-LL | let _ = drop(...);
- | ~~~~~~~~~
-
-warning: 1 warning emitted
-
+++ /dev/null
-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
-}
+++ /dev/null
-error: non-binding let on a synchronization lock
- --> $DIR/let_underscore_lock.rs:5:5
- |
-LL | let _ = data.lock().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[deny(let_underscore_lock)]` on by default
-help: consider binding to an unused variable
- |
-LL | let _unused = data.lock().unwrap();
- | ~~~~~~~
-help: consider explicitly droping with `std::mem::drop`
- |
-LL | let _ = drop(...);
- | ~~~~~~~~~
-
-error: aborting due to previous error
-
+++ /dev/null
-// run-pass
-// compile-flags: -W let_underscore_must_use
-
-#[must_use]
-struct MustUseType;
-
-#[must_use]
-fn must_use_function() -> () {}
-
-fn main() {
- let _ = MustUseType; //~WARNING non-binding let on a expression marked `must_use`
- let _ = must_use_function(); //~WARNING non-binding let on a expression marked `must_use`
-}
+++ /dev/null
-warning: non-binding let on a expression marked `must_use`
- --> $DIR/let_underscore_must_use.rs:11:5
- |
-LL | let _ = MustUseType;
- | ^^^^^^^^^^^^^^^^^^^^
- |
- = note: requested on the command line with `-W let-underscore-must-use`
-help: consider binding to an unused variable
- |
-LL | let _unused = MustUseType;
- | ~~~~~~~
-help: consider explicitly droping with `std::mem::drop`
- |
-LL | let _ = drop(...);
- | ~~~~~~~~~
-
-warning: non-binding let on a expression marked `must_use`
- --> $DIR/let_underscore_must_use.rs:12:5
- |
-LL | let _ = must_use_function();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-help: consider binding to an unused variable
- |
-LL | let _unused = must_use_function();
- | ~~~~~~~
-help: consider explicitly droping with `std::mem::drop`
- |
-LL | let _ = drop(...);
- | ~~~~~~~~~
-
-warning: 2 warnings emitted
-
--- /dev/null
+// run-pass
+// compile-flags: -W 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`
+}
--- /dev/null
+warning: non-binding let on a type that implements `Drop`
+ --> $DIR/let_underscore_drop.rs:13:5
+ |
+LL | let _ = NontrivialDrop;
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: requested on the command line with `-W let-underscore-drop`
+help: consider binding to an unused variable
+ |
+LL | let _unused = NontrivialDrop;
+ | ~~~~~~~
+help: consider explicitly droping with `std::mem::drop`
+ |
+LL | let _ = drop(...);
+ | ~~~~~~~~~
+
+warning: 1 warning emitted
+
--- /dev/null
+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
+}
--- /dev/null
+error: non-binding let on a synchronization lock
+ --> $DIR/let_underscore_lock.rs:5:5
+ |
+LL | let _ = data.lock().unwrap();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(let_underscore_lock)]` on by default
+help: consider binding to an unused variable
+ |
+LL | let _unused = data.lock().unwrap();
+ | ~~~~~~~
+help: consider explicitly droping with `std::mem::drop`
+ |
+LL | let _ = drop(...);
+ | ~~~~~~~~~
+
+error: aborting due to previous error
+
--- /dev/null
+// run-pass
+// compile-flags: -W let_underscore_must_use
+
+#[must_use]
+struct MustUseType;
+
+#[must_use]
+fn must_use_function() -> () {}
+
+fn main() {
+ let _ = MustUseType; //~WARNING non-binding let on a expression marked `must_use`
+ let _ = must_use_function(); //~WARNING non-binding let on a expression marked `must_use`
+}
--- /dev/null
+warning: non-binding let on a expression marked `must_use`
+ --> $DIR/let_underscore_must_use.rs:11:5
+ |
+LL | let _ = MustUseType;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: requested on the command line with `-W let-underscore-must-use`
+help: consider binding to an unused variable
+ |
+LL | let _unused = MustUseType;
+ | ~~~~~~~
+help: consider explicitly droping with `std::mem::drop`
+ |
+LL | let _ = drop(...);
+ | ~~~~~~~~~
+
+warning: non-binding let on a expression marked `must_use`
+ --> $DIR/let_underscore_must_use.rs:12:5
+ |
+LL | let _ = must_use_function();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: consider binding to an unused variable
+ |
+LL | let _unused = must_use_function();
+ | ~~~~~~~
+help: consider explicitly droping with `std::mem::drop`
+ |
+LL | let _ = drop(...);
+ | ~~~~~~~~~
+
+warning: 2 warnings emitted
+