// Test that we don't assume that the penultimate segment of an enum variant path refers to the // enum just because it has generic arguments. // // We once used to accept the code below interpreting `module::::Variant` // as `module::Variant::` basically. // // issue: enum Enum { Variant, Carry(T) } mod module { pub(super) use super::Enum::Variant; } fn main() { let _ = module::::Variant; //~^ ERROR type arguments are not allowed on module `module` let _ = self::module::<()>::Variant {}; //~^ ERROR type arguments are not allowed on module `module` }