gcc/testsuite/rust/compile/torture/impl_block2.rs
raw| 1 | struct Foo(i32, bool); |
| 2 | |
| 3 | impl Foo { |
| 4 | const number: i32 = 456; |
| 5 | |
| 6 | fn new(a: i32, b: bool) -> Foo { |
| 7 | Foo(a, b) |
| 8 | } |
| 9 | |
| 10 | fn test2() -> i32 { |
| 11 | test_forward_decl() |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | fn test_forward_decl() -> i32 { |
| 16 | 123 |
| 17 | } |
| 18 | |
| 19 | fn main() { |
| 20 | let a; |
| 21 | a = Foo::new(1, true); |
| 22 | |
| 23 | let b; |
| 24 | b = Foo::test2(); |
| 25 | |
| 26 | let c; |
| 27 | c = Foo::new(Foo::number, true); |
| 28 | } |