#![feature(const_type_id)] #![feature(generic_const_exprs)] #![feature(core_intrinsics)] #![allow(incomplete_features)] use std::any::TypeId; struct If; pub trait True {} impl True for If {} fn consume(_val: T) where If<{ TypeId::of::() != TypeId::of::<()>() }>: True, //~^ ERROR: can't compare { } fn test() where If<{ TypeId::of::() != TypeId::of::<()>() }>: True, //~^ ERROR: can't compare { } fn main() { let a = (); consume(0i32); consume(a); }