Closed
Description
I'm fairly sure this is a bug. At the very least It's confusing! Enabling uniform_paths
, there's a detected ambiguous use
for log
. But I can't figure out where the non-crate log is coming from. Furthermore, if I change use log;
to use self::log;
, just to see if it'll work, the compiler claims there's no log
module in the root!
I didn't run into any other cases like this (with the projects I've tried it with so far).
cargo new uniform-paths
- switch crate over to 2018 edition.
cargo add log
- in
src/main.rs
:
#![feature(rust_2018_preview, uniform_paths)]
use log;
fn main() {}
attempting to build:
error: import from `log` is ambiguous
--> src/main.rs:3:5
|
3 | use log;
| ^^^
| |
| could refer to external crate `::log`
| could also refer to `self::log`
|
= help: write `::log` or `self::log` explicitly instead
= note: relative `use` paths enabled by `#![feature(uniform_paths)]`
Changing log
to self::log
:
error[E0432]: unresolved import `self::log`
--> src/main.rs:3:5
|
3 | use self::log;
| ^^^^^^^^^ no `log` in the root
Playground link: https://play.rust-lang.org/?gist=f749f38540242c143f2e4c41e2f1625c&version=nightly&mode=debug&edition=2018