2022-01-14 05:39:29 -06:00
|
|
|
#![allow(unused)]
|
2022-01-16 23:50:40 -06:00
|
|
|
#![feature(const_fn_trait_bound, const_trait_impl, inline_const, negative_impls)]
|
2022-01-14 05:39:29 -06:00
|
|
|
|
|
|
|
const fn f<T: ~const Drop>(x: T) {}
|
|
|
|
|
|
|
|
struct UnconstDrop;
|
|
|
|
|
|
|
|
impl Drop for UnconstDrop {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
2022-01-16 23:50:40 -06:00
|
|
|
struct NonDrop;
|
|
|
|
|
|
|
|
impl !Drop for NonDrop {}
|
|
|
|
|
2022-01-14 05:39:29 -06:00
|
|
|
fn main() {
|
|
|
|
const {
|
|
|
|
f(UnconstDrop);
|
2021-12-24 08:50:44 -06:00
|
|
|
//~^ ERROR the trait bound `UnconstDrop: ~const Drop` is not satisfied
|
2022-01-16 23:50:40 -06:00
|
|
|
f(NonDrop);
|
2021-12-24 08:50:44 -06:00
|
|
|
//~^ ERROR the trait bound `NonDrop: ~const Drop` is not satisfied
|
2022-01-14 05:39:29 -06:00
|
|
|
}
|
|
|
|
}
|