aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/mod3.rs
blob: 2ace8c064d8ba1585707249895912d6cf3eba525 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-additional-options "-w" }
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
}