#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Trait {} pub struct EvaluatableU128; struct HasCastInTraitImpl; impl Trait for HasCastInTraitImpl {} pub fn use_trait_impl() where [(); { N + 1}]:, EvaluatableU128<{N as u128}>:, { fn assert_impl() {} // errors are bad but seems to be pre-existing issue #86198 assert_impl::>(); //~^ Error: mismatched types //~^^ Error: unconstrained generic constant assert_impl::>(); //~^ Error: mismatched types //~^^ Error: unconstrained generic constant assert_impl::>(); //~^ Error: mismatched types assert_impl::>(); //~^ Error: mismatched types } pub fn use_trait_impl_2() where [(); { N + 1}]:, EvaluatableU128<{N as _}>:, { fn assert_impl() {} // errors are bad but seems to be pre-existing issue #86198 assert_impl::>(); //~^ Error: mismatched types //~^^ Error: unconstrained generic constant assert_impl::>(); //~^ Error: mismatched types //~^^ Error: unconstrained generic constant assert_impl::>(); //~^ Error: mismatched types assert_impl::>(); //~^ Error: mismatched types } fn main() {}