diff options
Diffstat (limited to 'tests/mir-opt/inline_generically_if_sized.rs')
-rw-r--r-- | tests/mir-opt/inline_generically_if_sized.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/mir-opt/inline_generically_if_sized.rs b/tests/mir-opt/inline_generically_if_sized.rs new file mode 100644 index 000000000..1acfff7a5 --- /dev/null +++ b/tests/mir-opt/inline_generically_if_sized.rs @@ -0,0 +1,17 @@ +// 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() +} |