We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98efae8 commit 788261dCopy full SHA for 788261d
src/test/ui/higher-rank-trait-bounds/issue-59311.rs
@@ -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() {}
src/test/ui/higher-rank-trait-bounds/issue-59311.stderr
@@ -0,0 +1,8 @@
+error: higher-ranked subtype error
+ --> $DIR/issue-59311.rs:13:9
+ |
+LL | v.t(|| {});
+ | ^^^^^
+error: aborting due to previous error
0 commit comments