]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs
Rollup merge of #106570 - Xaeroxe:div-duration-tests, r=JohnTitor
[rust.git] / tests / ui / const-generics / generic_const_exprs / issue-79518-default_trait_method_normalization.rs
1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
3
4 // This test is a minimized reproduction for #79518 where
5 // during error handling for the type mismatch we would try
6 // to evaluate std::mem::size_of::<Self::Assoc> causing an ICE
7
8 trait Foo {
9     type Assoc: PartialEq;
10     const AssocInstance: Self::Assoc;
11
12     fn foo()
13     where
14         [(); std::mem::size_of::<Self::Assoc>()]: ,
15     {
16         Self::AssocInstance == [(); std::mem::size_of::<Self::Assoc>()];
17         //~^ Error: mismatched types
18     }
19 }
20
21 fn main() {}