rust/tests/ui/underscore-imports/issue-110164.rs
Esteban Küber d82fb1e72d Emit a single error when importing a path with _
When encountering `use _;`, `use _::*'` or similar, do not emit two errors for that single mistake. This also side-steps the issue of resolve errors suggesting adding a crate named `_` to `Cargo.toml`.
2025-06-24 16:21:26 +00:00

19 lines
506 B
Rust

//@ revisions: ed2015 ed2021
//@[ed2015] edition: 2015
//@[ed2021] edition: 2021
use self::*;
//~^ ERROR unresolved import `self::*`
use crate::*;
//~^ ERROR unresolved import `crate::*`
use _::a;
//~^ ERROR expected identifier, found reserved identifier `_`
use _::*;
//~^ ERROR expected identifier, found reserved identifier `_`
fn main() {
use _::a;
//~^ ERROR expected identifier, found reserved identifier `_`
use _::*;
//~^ ERROR expected identifier, found reserved identifier `_`
}