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

20 lines
362 B
Rust
Raw Normal View History

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