summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/dont_inline_type_id.rs
blob: 788c2f55dc02d31dfe22671cc469b7e5b4b7738c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// skip-filecheck
// unit-test: Inline
// compile-flags: --crate-type=lib -C panic=abort

use std::any::Any;
use std::any::TypeId;

struct A<T: ?Sized + 'static> {
    a: i32,
    b: T,
}

// EMIT_MIR dont_inline_type_id.call.Inline.diff
pub fn call<T: ?Sized + 'static>(s: &T) -> TypeId {
    s.type_id()
}