mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
18 lines
281 B
Rust
18 lines
281 B
Rust
// unit-test: Inline
|
|
// compile-flags: --crate-type=lib -C panic=abort
|
|
|
|
trait Foo {
|
|
fn bar(&self) -> i32;
|
|
}
|
|
|
|
impl<T> Foo for T {
|
|
fn bar(&self) -> i32 {
|
|
0
|
|
}
|
|
}
|
|
|
|
// EMIT_MIR inline_generically_if_sized.call.Inline.diff
|
|
pub fn call<T>(s: &T) -> i32 {
|
|
s.bar()
|
|
}
|