]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/issue-79518-default_trait_method_normalization.rs
New upstream version 1.54.0+dfsg1
[rustc.git] / src / test / ui / const-generics / issue-79518-default_trait_method_normalization.rs
1 #![feature(const_generics, const_evaluatable_checked)]
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() {}