Skip to content

Commit dbbdce5

Browse files
committed
add regression test for rust-lang#54124
Fixes rust-lang#54124
1 parent 3a17880 commit dbbdce5

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(nll)]
2+
3+
fn test<'a>() {
4+
let _:fn(&()) = |_:&'a ()| {};
5+
}
6+
7+
fn main() {
8+
test();
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: unsatisfied lifetime constraints
2+
--> $DIR/issue-54124.rs:4:22
3+
|
4+
LL | fn test<'a>() {
5+
| -- lifetime `'a` defined here
6+
LL | let _:fn(&()) = |_:&'a ()| {};
7+
| ^ - let's call the lifetime of this reference `'1`
8+
| |
9+
| requires that `'1` must outlive `'a`
10+
11+
error: unsatisfied lifetime constraints
12+
--> $DIR/issue-54124.rs:4:22
13+
|
14+
LL | fn test<'a>() {
15+
| -- lifetime `'a` defined here
16+
LL | let _:fn(&()) = |_:&'a ()| {};
17+
| ^ requires that `'a` must outlive `'static`
18+
19+
error: aborting due to 2 previous errors
20+

0 commit comments

Comments
 (0)