2024-11-24 00:30:16 +00:00
|
|
|
//@ check-pass
|
2021-12-21 13:23:59 +08:00
|
|
|
|
2024-11-19 17:08:52 +00:00
|
|
|
#![feature(const_trait_impl, const_destruct)]
|
2021-12-21 13:23:59 +08:00
|
|
|
|
2022-03-21 16:52:41 +11:00
|
|
|
use std::marker::Destruct;
|
|
|
|
|
|
2021-12-21 13:23:59 +08:00
|
|
|
pub trait Tr {}
|
|
|
|
|
|
|
|
|
|
#[allow(drop_bounds)]
|
|
|
|
|
impl<T: Drop> Tr for T {}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub struct S(i32);
|
|
|
|
|
|
|
|
|
|
impl Tr for S {}
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
const fn a<T: [const] Destruct>(t: T) {}
|
2021-12-21 13:23:59 +08:00
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
a(S(0));
|
|
|
|
|
}
|