24 lines
348 B
Rust
24 lines
348 B
Rust
// ignore-wasm32 compiled with panic=abort by default
|
|
// compile-flags: -Z span_free_formats
|
|
|
|
fn main() {
|
|
println!("{}", test(&()));
|
|
}
|
|
|
|
// EMIT_MIR inline_trait_method.test.Inline.after.mir
|
|
fn test(x: &dyn X) -> u32 {
|
|
x.y()
|
|
}
|
|
|
|
trait X {
|
|
fn y(&self) -> u32 {
|
|
1
|
|
}
|
|
}
|
|
|
|
impl X for () {
|
|
fn y(&self) -> u32 {
|
|
2
|
|
}
|
|
}
|