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 d1fff4a commit a0e81ecCopy full SHA for a0e81ec
src/test/ui/dropck/dropck_traits.rs
@@ -0,0 +1,48 @@
1
+// run-pass
2
+//! Regression test for #34426, regarding HRTB in drop impls
3
+
4
+pub trait Lifetime<'a> {}
5
+impl<'a> Lifetime<'a> for i32 {}
6
7
+#[allow(dead_code)]
8
+struct Foo<L>
9
+where
10
+ for<'a> L: Lifetime<'a>,
11
+{
12
+ l: L,
13
+}
14
15
+impl<L> Drop for Foo<L>
16
17
18
19
+ fn drop(&mut self) {
20
+ println!("drop with hrtb");
21
+ }
22
23
24
+pub trait Lifetime2<'a, 'b> {}
25
+impl<'a, 'b> Lifetime2<'a, 'b> for i32 {}
26
27
28
+struct Bar<L>
29
30
+ for<'a, 'b> L: Lifetime2<'a, 'b>,
31
32
33
34
35
+impl<L> Drop for Bar<L>
36
37
38
39
40
41
42
43
44
+fn main() {
45
+ let _foo = Foo { l: 0 };
46
47
+ let _bar = Bar { l: 0 };
48
0 commit comments