1
Fork 0
rust/src/test/ui/consts/const-block-const-bound.rs

24 lines
468 B
Rust
Raw Normal View History

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