rust/tests/codegen/local-generics-in-exe-internalized.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
371 B
Rust
Raw Normal View History

2023-03-16 21:18:28 -05:00
// compile-flags: -C no-prepopulate-passes -Zshare-generics=yes -Zinline-mir=no
// Check that local generics are internalized if they are in the same CGU
// CHECK-LABEL: ; local_generics_in_exe_internalized::foo
// CHECK-NEXT: ; Function Attrs:
// CHECK-NEXT: define internal
pub fn foo<T>(x: T, y: T) -> (T, T) {
(x, y)
}
fn main() {
let _ = foo(0u8, 1u8);
}