提交 dbbdce51 编写于 作者: N Niko Matsakis

add regression test for #54124

Fixes #54124
上级 3a178805
#![feature(nll)]
fn test<'a>() {
let _:fn(&()) = |_:&'a ()| {};
}
fn main() {
test();
}
error: unsatisfied lifetime constraints
--> $DIR/issue-54124.rs:4:22
|
LL | fn test<'a>() {
| -- lifetime `'a` defined here
LL | let _:fn(&()) = |_:&'a ()| {};
| ^ - let's call the lifetime of this reference `'1`
| |
| requires that `'1` must outlive `'a`
error: unsatisfied lifetime constraints
--> $DIR/issue-54124.rs:4:22
|
LL | fn test<'a>() {
| -- lifetime `'a` defined here
LL | let _:fn(&()) = |_:&'a ()| {};
| ^ requires that `'a` must outlive `'static`
error: aborting due to 2 previous errors
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册