Skip to content

Commit

Permalink
Add test for issue-57201
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Mar 9, 2020
1 parent fc8be08 commit 437c07f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/ui/impl-trait/issue-57201.rs
@@ -0,0 +1,14 @@
// Regression test for #57201

#![feature(impl_trait_in_bindings)]
#![allow(incomplete_features)]

fn bug<'a, 'b, T>()
where
'a: 'b,
{
let f: &impl Fn(&'a T) -> &'b T = &|x| x;
//~^ ERROR: lifetimes in impl Trait types in bindings are not currently supported
}

fn main() {}
8 changes: 8 additions & 0 deletions src/test/ui/impl-trait/issue-57201.stderr
@@ -0,0 +1,8 @@
error: lifetimes in impl Trait types in bindings are not currently supported
--> $DIR/issue-57201.rs:10:13
|
LL | let f: &impl Fn(&'a T) -> &'b T = &|x| x;
| ^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

0 comments on commit 437c07f

Please sign in to comment.