]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/inline-trait-method.rs
Simplify Cache wrapper to single type, impl Deref on it, fix all compilation errors...
[rust.git] / src / test / mir-opt / inline-trait-method.rs
1 // compile-flags: -Z span_free_formats
2
3 fn main() {
4     println!("{}", test(&()));
5 }
6
7 fn test(x: &dyn X) -> u32 {
8     x.y()
9 }
10
11 trait X {
12     fn y(&self) -> u32 {
13         1
14     }
15 }
16
17 impl X for () {
18     fn y(&self) -> u32 {
19         2
20     }
21 }
22
23 // END RUST SOURCE
24 // START rustc.test.Inline.after.mir
25 // ...
26 // bb0: {
27 // ...
28 //     _0 = const <dyn X as X>::y(move _2) -> bb1;
29 // }
30 // ...
31 // END rustc.test.Inline.after.mir