aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/mod1.rs
blob: 700393850afed3cc5b5bb6163accb3ed3bba481b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mod A {
    pub mod B {
        pub mod C {
            pub struct Foo {
                pub f: i32,
            }
            impl Foo {
                pub fn new() -> Self {
                    Foo { f: 23i32 }
                }
            }
        }
    }
}

fn main() -> i32 {
    let a = A::B::C::Foo::new();
    let b = A::B::C::Foo { f: -23i32 };

    a.f + b.f
}