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 88bd39b commit 57f9269Copy full SHA for 57f9269
tests/ui/issues/issue-143821.rs
@@ -0,0 +1,39 @@
1
+//@ check-pass
2
+// Regression test for issue https://github.com/rust-lang/rust/issues/143821
3
+// Tests that we don't ICE when borrow-checking nested closures with generic type parameters
4
+// and late-bound lifetime parameters.
5
+
6
+fn data_<T: 'static>(_: &()) -> &T {
7
+ loop {}
8
+}
9
10
+fn register<T, F>(f: F) -> IfaceToken<T>
11
+where
12
+ T: 'static,
13
+ F: FnOnce(&()),
14
+{
15
16
17
18
+fn method_with_cr_async<CB>(cb: CB)
19
20
+ CB: Fn(),
21
22
23
24
25
+struct IfaceToken<T: 'static>(T);
26
27
+fn foo<T>() -> IfaceToken<T> {
28
+ register::<T, _>(|b: &()| {
29
+ method_with_cr_async(|| {
30
+ data_::<T>(&());
31
+ });
32
+ })
33
34
35
+struct A();
36
37
+fn main() {
38
+ foo::<A>();
39
0 commit comments