summaryrefslogtreecommitdiffstats
path: root/tests/codegen/local-generics-in-exe-internalized.rs
blob: 449c5ca75fcdf60512245ef306f763bba8f9ea41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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);
}