2024-03-23 11:30:44 -05:00
|
|
|
// Check that we detect imports that are redundant due to the language prelude
|
|
|
|
// and that we emit a reasonable diagnostic.
|
2024-04-11 13:10:34 -05:00
|
|
|
//~^^ NOTE the item `u8` is already defined by the extern prelude
|
2024-03-23 11:30:44 -05:00
|
|
|
|
|
|
|
// Note that we use the term "extern prelude" in the label even though "language prelude"
|
|
|
|
// would be more correct. However, it's not worth special-casing this.
|
|
|
|
|
|
|
|
// See also the discussion in <https://github.com/rust-lang/rust/pull/122954>.
|
|
|
|
|
2024-04-11 13:10:34 -05:00
|
|
|
#![deny(redundant_imports)]
|
|
|
|
//~^ NOTE the lint level is defined here
|
2024-03-23 11:30:44 -05:00
|
|
|
|
|
|
|
use std::primitive::u8;
|
2024-04-11 13:10:34 -05:00
|
|
|
//~^ ERROR the item `u8` is imported redundantly
|
2024-03-23 11:30:44 -05:00
|
|
|
|
|
|
|
const _: u8 = 0;
|
|
|
|
|
|
|
|
fn main() {}
|