]>
Commit | Line | Data |
---|---|---|
5099ac24 | 1 | #![allow(unused)] |
5e7ed085 | 2 | #![feature(const_trait_impl, inline_const, negative_impls)] |
5099ac24 | 3 | |
5e7ed085 FG |
4 | use std::marker::Destruct; |
5 | ||
6 | const fn f<T: ~const Destruct>(x: T) {} | |
5099ac24 FG |
7 | |
8 | struct UnconstDrop; | |
9 | ||
10 | impl Drop for UnconstDrop { | |
11 | fn drop(&mut self) {} | |
12 | } | |
13 | ||
14 | struct NonDrop; | |
15 | ||
16 | impl !Drop for NonDrop {} | |
17 | ||
18 | fn main() { | |
19 | const { | |
20 | f(UnconstDrop); | |
5e7ed085 | 21 | //~^ ERROR can't drop |
5099ac24 | 22 | f(NonDrop); |
5e7ed085 | 23 | //~^ ERROR can't drop |
5099ac24 FG |
24 | } |
25 | } |