]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs
Merge commit '4c41a222ca5d1325fb4b6709395bd06e766cc042' into clippyup
[rust.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() {}