]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/inline/inline_trait_method_2.rs
Auto merge of #102717 - beetrees:repr128-c-style-debuginfo, r=nagisa
[rust.git] / src / test / mir-opt / inline / inline_trait_method_2.rs
1 // compile-flags: -Z span_free_formats -Z mir-opt-level=4
2
3 // EMIT_MIR inline_trait_method_2.test2.Inline.after.mir
4 fn test2(x: &dyn X) -> bool {
5     test(x)
6 }
7
8 #[inline]
9 fn test(x: &dyn X) -> bool {
10     x.y()
11 }
12
13 trait X {
14     fn y(&self) -> bool {
15         false
16     }
17 }
18
19 impl X for () {
20     fn y(&self) -> bool {
21         true
22     }
23 }
24
25 fn main() {
26     println!("Should be true: {}", test2(&()));
27 }