]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const_cmp_type_id.rs
Rollup merge of #106951 - tmiasko:rm-simplify-initial, r=oli-obk
[rust.git] / tests / ui / consts / const_cmp_type_id.rs
1 // run-pass
2 #![feature(const_type_id)]
3 #![feature(const_trait_impl)]
4
5 use std::any::TypeId;
6
7 const fn main() {
8     assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
9     assert!(TypeId::of::<()>() != TypeId::of::<u8>());
10     const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
11     // can't assert `_A` because it is not deterministic
12 }