Open
Description
This may be related to #62768.
Given this code:
pub use Foo::*;
#[derive(Debug)]
pub enum Foo {
Foo(i32),
}
The compiler errors, saying that the Foo
in use Foo::*
may refer both to the enum (type-namespace) Foo
and the yet-to-be-imported variant (value-namespace) Foo::Foo
:
error[E0659]: `Foo` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
--> src/lib.rs:1:9
|
1 | pub use Foo::*;
| ^^^ ambiguous name
|
note: `Foo` could refer to the enum defined here
--> src/lib.rs:3:1
|
3 | / pub enum Foo {
4 | | Foo(i32),
5 | | }
| |_^
note: `Foo` could also refer to the variant imported here
--> src/lib.rs:1:9
|
1 | pub use Foo::*;
| ^^^^^^
= help: consider adding an explicit import of `Foo` to disambiguate
However, if I remove the #[derive(Debug)]
, then the code compiles just fine as expected (playpen).