]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-11047.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-11047.rs
1 // run-pass
2 // Test that static methods can be invoked on `type` aliases
3
4 #![allow(unused_variables)]
5
6 pub mod foo {
7 pub mod bar {
8 pub mod baz {
9 pub struct Qux;
10
11 impl Qux {
12 pub fn new() {}
13 }
14 }
15 }
16 }
17
18 fn main() {
19
20 type Ham = foo::bar::baz::Qux;
21 let foo = foo::bar::baz::Qux::new(); // invoke directly
22 let bar = Ham::new(); // invoke via type alias
23
24 type StringVec = Vec<String>;
25 let sv = StringVec::new();
26 }