We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a13b13f commit 4eab5c1Copy full SHA for 4eab5c1
src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
@@ -0,0 +1,31 @@
1
+#![feature(const_trait_impl)]
2
+#![feature(const_mut_refs)]
3
+#![feature(const_fn_trait_bound)]
4
+
5
+struct NonTrivialDrop;
6
7
+impl Drop for NonTrivialDrop {
8
+ fn drop(&mut self) {
9
+ println!("Non trivial drop");
10
+ }
11
+}
12
13
+struct ConstImplWithDropGlue(NonTrivialDrop);
14
15
+impl const Drop for ConstImplWithDropGlue {
16
+ fn drop(&mut self) {}
17
18
19
+const fn check<T: ~const Drop>() {}
20
21
+macro_rules! check_all {
22
+ ($($T:ty),*$(,)?) => {$(
23
+ const _: () = check::<$T>();
24
+ )*};
25
26
27
+check_all! {
28
+ ConstImplWithDropGlue,
29
30
31
+fn main() {}
0 commit comments