rust/tests/ui/imports/redundant-import-lang-prelude-attr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
643 B
Rust
Raw Normal View History

// Check that we detect imports (of built-in attributes) that are redundant due to
// the language prelude and that we emit a reasonable diagnostic.
2024-04-11 14:10:34 -04:00
//~^^ NOTE the item `allow` is already defined by the extern prelude
// 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>.
//@ edition: 2018
2024-04-11 14:10:34 -04:00
#![deny(redundant_imports)]
//~^ NOTE the lint level is defined here
2024-04-11 14:10:34 -04:00
use allow; //~ ERROR the item `allow` is imported redundantly
#[allow(unused)]
fn main() {}