Skip to content

Commit 437c07f

Browse files
committed
Add test for issue-57201
1 parent fc8be08 commit 437c07f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/test/ui/impl-trait/issue-57201.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Regression test for #57201
2+
3+
#![feature(impl_trait_in_bindings)]
4+
#![allow(incomplete_features)]
5+
6+
fn bug<'a, 'b, T>()
7+
where
8+
'a: 'b,
9+
{
10+
let f: &impl Fn(&'a T) -> &'b T = &|x| x;
11+
//~^ ERROR: lifetimes in impl Trait types in bindings are not currently supported
12+
}
13+
14+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: lifetimes in impl Trait types in bindings are not currently supported
2+
--> $DIR/issue-57201.rs:10:13
3+
|
4+
LL | let f: &impl Fn(&'a T) -> &'b T = &|x| x;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)