]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/inline/inline_trait_method.rs
Rollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
[rust.git] / tests / mir-opt / inline / inline_trait_method.rs
1 // compile-flags: -Z span_free_formats
2
3 fn main() {
4     println!("{}", test(&()));
5 }
6
7 // EMIT_MIR inline_trait_method.test.Inline.after.mir
8 fn test(x: &dyn X) -> u32 {
9     x.y()
10 }
11
12 trait X {
13     fn y(&self) -> u32 {
14         1
15     }
16 }
17
18 impl X for () {
19     fn y(&self) -> u32 {
20         2
21     }
22 }