Skip to content

Commit

Permalink
Remove ambiguity error removed in Rust 1.72.
Browse files Browse the repository at this point in the history
This was changed in rust-lang/rust#56414
to favor in-scope items.
  • Loading branch information
ehuss committed Jun 30, 2024
1 parent 91cc51d commit 325b14e
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/items/use-declarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,18 +380,6 @@ pub use bar::*;
# fn main() {}
```

If an in-scope item has the same name as a crate name in the [extern prelude], then `use` of that crate name requires a leading `::` to unambiguously select the crate name or `crate::` to use the item from the crate root.

```rust,compile_fail
use std::fs; // Error, this is ambiguous.
mod std {
pub mod fs {}
}
# fn main() {}
```


[_SimplePath_]: ../paths.md#simple-paths
[`extern crate`]: extern-crates.md
[`macro_rules`]: ../macros-by-example.md
Expand Down

0 comments on commit 325b14e

Please sign in to comment.