2022-02-11 18:21:02 -06:00
|
|
|
error: unused attribute `must_use`
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:58:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: the built-in attribute `must_use` will be ignored, since it's applied to the macro invocation `global_asm`
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:59:1
|
|
|
|
|
|
|
|
|
LL | global_asm!("");
|
|
|
|
| ^^^^^^^^^^
|
2022-09-18 10:55:36 -05:00
|
|
|
note: the lint level is defined here
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:2:9
|
|
|
|
|
|
|
|
|
LL | #![deny(unused_attributes, unused_must_use)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
2022-02-11 18:21:02 -06:00
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to an extern crate
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:5:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a module
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:8:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a use
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:11:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a constant item
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:14:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a static item
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:16:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2022-08-02 22:11:22 -05:00
|
|
|
error: `#[must_use]` has no effect when applied to an implementation block
|
2022-02-11 18:21:02 -06:00
|
|
|
--> $DIR/unused_attributes-must_use.rs:33:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a foreign module
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:47:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a type alias
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:61:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a type parameter
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:64:8
|
|
|
|
|
|
|
|
|
LL | fn qux<#[must_use] T>(_: T) {}
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2022-08-02 22:11:22 -05:00
|
|
|
error: `#[must_use]` has no effect when applied to an implementation block
|
2022-02-11 18:21:02 -06:00
|
|
|
--> $DIR/unused_attributes-must_use.rs:79:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a trait alias
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:84:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a macro def
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:87:1
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a statement
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:95:5
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a closure
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:99:13
|
|
|
|
|
|
|
|
|
LL | let x = #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to an match arm
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:121:9
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2022-05-22 20:34:37 -05:00
|
|
|
error: `#[must_use]` has no effect when applied to a struct field
|
2022-05-03 15:23:03 -05:00
|
|
|
--> $DIR/unused_attributes-must_use.rs:129:28
|
|
|
|
|
|
|
|
|
LL | let s = PatternField { #[must_use] foo: 123 };
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2022-05-03 13:52:53 -05:00
|
|
|
error: `#[must_use]` has no effect when applied to a pattern field
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:130:24
|
|
|
|
|
|
|
|
|
LL | let PatternField { #[must_use] foo } = s;
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
2022-02-11 18:21:02 -06:00
|
|
|
error: `#[must_use]` has no effect when applied to an associated const
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:68:5
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to an associated type
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:70:5
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: `#[must_use]` has no effect when applied to a foreign static item
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:50:5
|
|
|
|
|
|
|
|
|
LL | #[must_use]
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: unused `X` that must be used
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:103:5
|
|
|
|
|
|
|
|
|
LL | X;
|
2022-08-16 09:46:33 -05:00
|
|
|
| ^
|
2022-02-11 18:21:02 -06:00
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:2:28
|
|
|
|
|
|
|
|
|
LL | #![deny(unused_attributes, unused_must_use)]
|
|
|
|
| ^^^^^^^^^^^^^^^
|
2023-03-10 23:28:05 -06:00
|
|
|
help: use `let _ = ...` to ignore the resulting value
|
|
|
|
|
|
|
|
|
LL | let _ = X;
|
|
|
|
| +++++++
|
2022-02-11 18:21:02 -06:00
|
|
|
|
|
|
|
error: unused `Y` that must be used
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:104:5
|
|
|
|
|
|
|
|
|
LL | Y::Z;
|
2022-08-16 09:46:33 -05:00
|
|
|
| ^^^^
|
2023-03-10 23:28:05 -06:00
|
|
|
|
|
|
|
|
help: use `let _ = ...` to ignore the resulting value
|
|
|
|
|
|
|
|
|
LL | let _ = Y::Z;
|
|
|
|
| +++++++
|
2022-02-11 18:21:02 -06:00
|
|
|
|
|
|
|
error: unused `U` that must be used
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:105:5
|
|
|
|
|
|
|
|
|
LL | U { unit: () };
|
2022-08-16 09:46:33 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2023-03-10 23:28:05 -06:00
|
|
|
|
|
|
|
|
help: use `let _ = ...` to ignore the resulting value
|
|
|
|
|
|
|
|
|
LL | let _ = U { unit: () };
|
|
|
|
| +++++++
|
2022-02-11 18:21:02 -06:00
|
|
|
|
|
|
|
error: unused return value of `U::method` that must be used
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:106:5
|
|
|
|
|
|
|
|
|
LL | U::method();
|
2022-08-16 09:46:33 -05:00
|
|
|
| ^^^^^^^^^^^
|
2023-03-10 23:28:05 -06:00
|
|
|
|
|
|
|
|
help: use `let _ = ...` to ignore the resulting value
|
|
|
|
|
|
|
|
|
LL | let _ = U::method();
|
|
|
|
| +++++++
|
2022-02-11 18:21:02 -06:00
|
|
|
|
|
|
|
error: unused return value of `foo` that must be used
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:107:5
|
|
|
|
|
|
|
|
|
LL | foo();
|
2022-08-16 09:46:33 -05:00
|
|
|
| ^^^^^
|
2023-03-10 23:28:05 -06:00
|
|
|
|
|
|
|
|
help: use `let _ = ...` to ignore the resulting value
|
|
|
|
|
|
|
|
|
LL | let _ = foo();
|
|
|
|
| +++++++
|
2022-02-11 18:21:02 -06:00
|
|
|
|
|
|
|
error: unused return value of `foreign_foo` that must be used
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:110:9
|
|
|
|
|
|
|
|
|
LL | foreign_foo();
|
2022-08-16 09:46:33 -05:00
|
|
|
| ^^^^^^^^^^^^^
|
2023-03-10 23:28:05 -06:00
|
|
|
|
|
|
|
|
help: use `let _ = ...` to ignore the resulting value
|
|
|
|
|
|
|
|
|
LL | let _ = foreign_foo();
|
|
|
|
| +++++++
|
2022-02-11 18:21:02 -06:00
|
|
|
|
|
|
|
error: unused return value of `Use::get_four` that must be used
|
|
|
|
--> $DIR/unused_attributes-must_use.rs:118:5
|
|
|
|
|
|
|
|
|
LL | ().get_four();
|
2022-08-16 09:46:33 -05:00
|
|
|
| ^^^^^^^^^^^^^
|
2023-03-10 23:28:05 -06:00
|
|
|
|
|
|
|
|
help: use `let _ = ...` to ignore the resulting value
|
|
|
|
|
|
|
|
|
LL | let _ = ().get_four();
|
|
|
|
| +++++++
|
2022-02-11 18:21:02 -06:00
|
|
|
|
2022-05-03 15:23:03 -05:00
|
|
|
error: aborting due to 28 previous errors
|
2022-02-11 18:21:02 -06:00
|
|
|
|