]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-needs_drop-monomorphic.rs
Do not suggest `let_else` if no bindings would be introduced
[rust.git] / src / test / ui / consts / const-needs_drop-monomorphic.rs
1 // Check that evaluation of needs_drop<T> fails when T is not monomorphic.
2 #![feature(generic_const_exprs)]
3 #![allow(const_evaluatable_unchecked)]
4 #![allow(incomplete_features)]
5
6 struct Bool<const B: bool> {}
7 impl Bool<true> {
8     fn assert() {}
9 }
10 fn f<T>() {
11     Bool::<{ std::mem::needs_drop::<T>() }>::assert();
12     //~^ ERROR no function or associated item named `assert` found
13     //~| ERROR unconstrained generic constant
14 }
15 fn main() {
16     f::<u32>();
17 }