summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const_cmp_type_id.rs
blob: f10d1c24f7dedfb1397d1286a277c759619e76cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// run-pass
#![feature(const_type_id)]
#![feature(const_trait_impl)]

use std::any::TypeId;

const fn main() {
    assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
    assert!(TypeId::of::<()>() != TypeId::of::<u8>());
    const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
    // can't assert `_A` because it is not deterministic
}