]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-24085.rs
Rollup merge of #62169 - Zoxc:store-query-results, r=eddyb
[rust.git] / src / test / ui / issues / issue-24085.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2 #![allow(dead_code)]
3 // Regression test for #24085. Errors were occurring in region
4 // inference due to the requirement that `'a:b'`, which was getting
5 // incorrectly codegened in connection with the closure below.
6
7 #[derive(Copy,Clone)]
8 struct Path<'a:'b, 'b> {
9     x: &'a i32,
10     tail: Option<&'b Path<'a, 'b>>
11 }
12
13 #[allow(dead_code, unconditional_recursion)]
14 fn foo<'a,'b,F>(p: Path<'a, 'b>, mut f: F)
15                 where F: for<'c> FnMut(Path<'a, 'c>) {
16     foo(p, |x| f(x))
17 }
18
19 fn main() { }