Failing test
This commit is contained in:
parent
a13b13ff46
commit
4eab5c1f7b
1 changed files with 31 additions and 0 deletions
31
src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
Normal file
31
src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#![feature(const_trait_impl)]
|
||||||
|
#![feature(const_mut_refs)]
|
||||||
|
#![feature(const_fn_trait_bound)]
|
||||||
|
|
||||||
|
struct NonTrivialDrop;
|
||||||
|
|
||||||
|
impl Drop for NonTrivialDrop {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
println!("Non trivial drop");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ConstImplWithDropGlue(NonTrivialDrop);
|
||||||
|
|
||||||
|
impl const Drop for ConstImplWithDropGlue {
|
||||||
|
fn drop(&mut self) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
const fn check<T: ~const Drop>() {}
|
||||||
|
|
||||||
|
macro_rules! check_all {
|
||||||
|
($($T:ty),*$(,)?) => {$(
|
||||||
|
const _: () = check::<$T>();
|
||||||
|
)*};
|
||||||
|
}
|
||||||
|
|
||||||
|
check_all! {
|
||||||
|
ConstImplWithDropGlue,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue