]>
Commit | Line | Data |
---|---|---|
8faf50e0 XL |
1 | // Regression test for #48071. This test used to ICE because -- in |
2 | // the leak-check -- it would pass since we knew that the return type | |
3 | // was `'static`, and hence `'static: 'a` was legal even for a | |
4 | // placeholder region, but in NLL land it would fail because we had | |
5 | // rewritten `'static` to a region variable. | |
6 | // | |
60c5eb7d | 7 | // check-pass |
8faf50e0 | 8 | |
8faf50e0 XL |
9 | trait Foo { |
10 | fn foo(&self) { } | |
11 | } | |
12 | ||
13 | impl Foo for () { | |
14 | } | |
15 | ||
16 | type MakeFooFn = for<'a> fn(&'a u8) -> Box<dyn Foo + 'a>; | |
17 | ||
18 | fn make_foo(x: &u8) -> Box<dyn Foo + 'static> { | |
19 | Box::new(()) | |
20 | } | |
21 | ||
22 | fn main() { | |
23 | let x: MakeFooFn = make_foo as MakeFooFn; | |
24 | } |