]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / const-generics / dont-evaluate-array-len-on-err-1.rs
1 #![feature(const_generics, const_evaluatable_checked)]
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() {}