// Cargo.toml: a rust-version <= 1.79 (while being on 1.80 or nightly)
#![warn(unused_qualifications)]
let align = core::mem::align_of::<u128>();
dbg!(align);
Current output
warning: unnecessary qualification
--> src/main.rs:9:17
|
9 | let align = core::mem::align_of::<u128>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> src/main.rs:2:9
|
2 | #![warn(unused_qualifications, unused_imports)]
| ^^^^^^^^^^^^^^^^^^^^^
help: remove the unnecessary path segments
|
9 - let align = core::mem::align_of::<u128>();
9 + let align = align_of::<u128>();
|
Adding use core::mem::align_of (or std::…) and using it that way will not trigger unused_imports (warn-by-default) on 1.80 which is somewhat weird. Applying the fixes for unused_qualifications changes the MSRV while unused_imports doesn't?
I somewhat expect this to be closed as won't fix as rustc itself doesn't care about cargo related settings?
Code
Current output
Desired output
The lint should not be triggered as
core::mem::align_of
is only part of the prelude since 1.80 (see https://github.com/rust-lang/rust/pull/123168/)Rationale and extra context
Adding
use core::mem::align_of
(orstd::…
) and using it that way will not triggerunused_imports
(warn-by-default) on 1.80 which is somewhat weird. Applying the fixes forunused_qualifications
changes the MSRV whileunused_imports
doesn't?I somewhat expect this to be closed as won't fix as
rustc
itself doesn't care about cargo related settings?Other cases
No response
Rust Version
Anything else?
No response