rust/tests/ui/consts/const-block-const-bound.rs

26 lines
406 B
Rust
Raw Normal View History

2022-01-14 05:39:29 -06:00
#![allow(unused)]
#![feature(const_trait_impl, inline_const, negative_impls)]
2022-01-14 05:39:29 -06:00
use std::marker::Destruct;
const fn f<T: ~const Destruct>(x: T) {}
2022-01-14 05:39:29 -06:00
struct UnconstDrop;
impl Drop for UnconstDrop {
fn drop(&mut self) {}
}
struct NonDrop;
impl !Drop for NonDrop {}
2022-01-14 05:39:29 -06:00
fn main() {
const {
f(UnconstDrop);
//~^ ERROR can't drop
f(NonDrop);
//~^ ERROR can't drop
2022-01-14 05:39:29 -06:00
}
}