2022-01-14 03:39:29 -08:00
|
|
|
#![allow(unused)]
|
2024-11-21 23:20:59 +00:00
|
|
|
#![feature(const_trait_impl, negative_impls, const_destruct)]
|
2022-01-14 03:39:29 -08:00
|
|
|
|
2022-03-21 16:52:41 +11:00
|
|
|
use std::marker::Destruct;
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
const fn f<T: [const] Destruct>(x: T) {}
|
2022-01-14 03:39:29 -08:00
|
|
|
|
|
|
|
|
struct UnconstDrop;
|
|
|
|
|
|
|
|
|
|
impl Drop for UnconstDrop {
|
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
const {
|
|
|
|
|
f(UnconstDrop);
|
2025-01-15 09:21:51 +01:00
|
|
|
//~^ ERROR trait bound `UnconstDrop: const Destruct` is not satisfied
|
2022-01-14 03:39:29 -08:00
|
|
|
}
|
|
|
|
|
}
|