Rollup merge of #62000 - JohnTitor:add-test-issue-54189, r=cramertj

Add test for issue-54189

Closes #54189
This commit is contained in:
Mazdak Farrokhzad 2019-06-20 22:14:29 +02:00 committed by GitHub
commit 9e5ace6f43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,6 @@
fn bug() -> impl for <'r> Fn() -> &'r () { || { &() } }
//~^ ERROR binding for associated type `Output` references lifetime `'r`
fn main() {
let f = bug();
}

View file

@ -0,0 +1,9 @@
error[E0582]: binding for associated type `Output` references lifetime `'r`, which does not appear in the trait input types
--> $DIR/issue-54189.rs:1:35
|
LL | fn bug() -> impl for <'r> Fn() -> &'r () { || { &() } }
| ^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0582`.