]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/issues/issue-90318.rs
implement Hash for proc_macro::LineColumn
[rust.git] / tests / ui / const-generics / issues / issue-90318.rs
1 #![feature(const_type_id)]
2 #![feature(generic_const_exprs)]
3 #![feature(core_intrinsics)]
4 #![allow(incomplete_features)]
5
6 use std::any::TypeId;
7
8 struct If<const B: bool>;
9 pub trait True {}
10 impl True for If<true> {}
11
12 fn consume<T: 'static>(_val: T)
13 where
14     If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
15     //~^ ERROR: can't compare
16 {
17 }
18
19 fn test<T: 'static>()
20 where
21     If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
22     //~^ ERROR: can't compare
23 {
24 }
25
26 fn main() {
27     let a = ();
28     consume(0i32);
29     consume(a);
30 }