-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.P-mediumMedium priorityMedium priority
Description
Compile this:
pub mod foo {
pub mod bar {
pub mod baz {
struct Qux;
impl Qux {
pub fn new() {}
}
}
}
}
fn main() {
type Ham = foo::bar::baz::Qux;
let Foo = foo::bar::baz::Qux::new(); // works fine
let Bar = Ham::new(); // oops!
}$ rustc ty.rs
!!! (resolving module in lexical scope) module wasn't actually a module!
ty.rs:16:14: 16:22 error: unresolved name
ty.rs:16 let Bar = Ham::new();
^~~~~~~~
ty.rs:16:14: 16:22 error: use of undeclared module `Ham`
ty.rs:16 let Bar = Ham::new();
^~~~~~~~
!!! (resolving module in lexical scope) module wasn't actually a module!
ty.rs:16:14: 16:22 error: unresolved name `Ham::new`.
ty.rs:16 let Bar = Ham::new();
^~~~~~~~
error: aborting due to 3 previous errors
task 'rustc' failed at 'explicit failure', /root/catacombs/scrap/rust/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /root/catacombs/scrap/rust/src/librustc/lib.rs:392
I can't imagine that this is intentional, as it greatly limits the utility of type aliases.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.P-mediumMedium priorityMedium priority
Type
Fields
Give feedbackNo fields configured for issues without a type.