2023-04-05 03:44:20 -05:00
|
|
|
// ignore-wasm32 compiled with panic=abort by default
|
2018-10-11 20:28:20 -05:00
|
|
|
// compile-flags: -Z span_free_formats
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("{}", test(&()));
|
|
|
|
}
|
|
|
|
|
2020-07-27 14:22:43 -05:00
|
|
|
// EMIT_MIR inline_trait_method.test.Inline.after.mir
|
2018-10-11 20:28:20 -05:00
|
|
|
fn test(x: &dyn X) -> u32 {
|
|
|
|
x.y()
|
|
|
|
}
|
|
|
|
|
|
|
|
trait X {
|
|
|
|
fn y(&self) -> u32 {
|
|
|
|
1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl X for () {
|
|
|
|
fn y(&self) -> u32 {
|
|
|
|
2
|
|
|
|
}
|
|
|
|
}
|