summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/issues/issue-90318.rs
blob: d6c48e63bb3ce70f98fbdbebddae06b2019356a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#![feature(const_type_id)]
#![feature(generic_const_exprs)]
#![feature(core_intrinsics)]
#![allow(incomplete_features)]

use std::any::TypeId;

struct If<const B: bool>;
pub trait True {}
impl True for If<true> {}

fn consume<T: 'static>(_val: T)
where
    If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
    //~^ ERROR: can't compare
{
}

fn test<T: 'static>()
where
    If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
    //~^ ERROR: can't compare
{
}

fn main() {
    let a = ();
    consume(0i32);
    consume(a);
}