#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait MiniTypeId { const TYPE_ID: u64; } impl MiniTypeId for T { const TYPE_ID: u64 = 0; } enum Lift {} trait IsFalse {} impl IsFalse for Lift {} const fn is_same_type() -> bool { T::TYPE_ID == U::TYPE_ID } fn requires_distinct(_a: A, _b: B) where A: MiniTypeId, B: MiniTypeId, Lift<{is_same_type::()}>: IsFalse {} fn main() { requires_distinct("str", 12); //~^ ERROR mismatched types }