]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/generic_const_exprs/obligation-cause.rs
Rollup merge of #106524 - compiler-errors:constructor-note, r=cjgillot
[rust.git] / tests / ui / const-generics / generic_const_exprs / obligation-cause.rs
1 #![allow(incomplete_features)]
2 #![feature(generic_const_exprs)]
3
4 trait True {}
5
6 struct Is<const V: bool>;
7
8 impl True for Is<true> {}
9
10 fn g<T>()
11 //~^ NOTE required by a bound in this
12 where
13     Is<{ std::mem::size_of::<T>() == 0 }>: True,
14     //~^ NOTE required by a bound in `g`
15     //~| NOTE required by this bound in `g`
16 {
17 }
18
19 fn main() {
20     g::<usize>();
21     //~^ ERROR mismatched types
22     //~| NOTE expected `false`, found `true`
23     //~| NOTE expected constant `false`
24 }