2022-01-14 03:39:29 -08:00
|
|
|
#![allow(unused)]
|
2022-02-09 10:53:40 -08:00
|
|
|
#![feature(const_trait_impl, inline_const, negative_impls)]
|
2022-01-14 03:39:29 -08:00
|
|
|
|
2022-03-21 16:52:41 +11:00
|
|
|
use std::marker::Destruct;
|
|
|
|
|
|
|
|
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) {}
|
|
|
|
}
|
|
|
|
|
2022-01-17 14:50:40 +09:00
|
|
|
struct NonDrop;
|
|
|
|
|
|
|
|
impl !Drop for NonDrop {}
|
|
|
|
|
2022-01-14 03:39:29 -08:00
|
|
|
fn main() {
|
|
|
|
const {
|
|
|
|
f(UnconstDrop);
|
2022-03-21 16:52:41 +11:00
|
|
|
//~^ ERROR can't drop
|
2022-01-17 14:50:40 +09:00
|
|
|
f(NonDrop);
|
2022-03-21 16:52:41 +11:00
|
|
|
//~^ ERROR can't drop
|
2022-01-14 03:39:29 -08:00
|
|
|
}
|
|
|
|
}
|