]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/dont-evaluate-array-len-on-err-1.rs
Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / dont-evaluate-array-len-on-err-1.rs
1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
3
4 // This tests that during error handling for the "trait not implemented" error
5 // we dont try to evaluate std::mem::size_of::<Self::Assoc> causing an ICE
6
7 struct Adt;
8
9 trait Foo {
10     type Assoc;
11     fn foo()
12     where
13         [Adt; std::mem::size_of::<Self::Assoc>()]: ,
14     {
15         <[Adt; std::mem::size_of::<Self::Assoc>()] as Foo>::bar()
16         //~^ Error: the trait bound
17     }
18
19     fn bar() {}
20 }
21
22 fn main() {}