Skip to content

Commit 788261d

Browse files
committed
Add regression test for issue-59311
1 parent 98efae8 commit 788261d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Regression test for #59311. The test is taken from
2+
// rust-lang/rust/issues/71546#issuecomment-620638437
3+
// as they seem to have the same cause.
4+
5+
pub trait T {
6+
fn t<F: Fn()>(&self, _: F) {}
7+
}
8+
9+
pub fn crash<V>(v: &V)
10+
where
11+
for<'a> &'a V: T + 'static,
12+
{
13+
v.t(|| {}); //~ ERROR: higher-ranked subtype error
14+
}
15+
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: higher-ranked subtype error
2+
--> $DIR/issue-59311.rs:13:9
3+
|
4+
LL | v.t(|| {});
5+
| ^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)