mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
23 lines
294 B
Rust
23 lines
294 B
Rust
// 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
|
|
}
|
|
}
|