Add test for issue-57201

This commit is contained in:
Yuki Okushi 2020-03-09 09:12:06 +09:00
parent fc8be08a8e
commit 437c07f662
No known key found for this signature in database
GPG Key ID: B0986C85C0E2DAA1
2 changed files with 22 additions and 0 deletions

View File

@ -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() {}

View File

@ -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