2021-06-04 00:00:00 +00:00
|
|
|
// Check that evaluation of needs_drop<T> fails when T is not monomorphic.
|
2021-08-27 16:04:57 +00:00
|
|
|
#![feature(generic_const_exprs)]
|
2021-06-04 00:00:00 +00:00
|
|
|
#![allow(const_evaluatable_unchecked)]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
struct Bool<const B: bool> {}
|
|
|
|
impl Bool<true> {
|
|
|
|
fn assert() {}
|
|
|
|
}
|
|
|
|
fn f<T>() {
|
|
|
|
Bool::<{ std::mem::needs_drop::<T>() }>::assert();
|
|
|
|
//~^ ERROR no function or associated item named `assert` found
|
2021-08-27 16:04:57 +00:00
|
|
|
//~| ERROR unconstrained generic constant
|
2021-06-04 00:00:00 +00:00
|
|
|
}
|
|
|
|
fn main() {
|
|
|
|
f::<u32>();
|
|
|
|
}
|