Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #75215

Closed
wants to merge 15 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add regression test for issue-59311
  • Loading branch information
JohnTitor committed Jul 28, 2020
commit 788261d2d30c92c7423a68088aaee32ce44f9520
16 changes: 16 additions & 0 deletions src/test/ui/higher-rank-trait-bounds/issue-59311.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Regression test for #59311. The test is taken from
// rust-lang/rust/issues/71546#issuecomment-620638437
// as they seem to have the same cause.

pub trait T {
fn t<F: Fn()>(&self, _: F) {}
}

pub fn crash<V>(v: &V)
where
for<'a> &'a V: T + 'static,
{
v.t(|| {}); //~ ERROR: higher-ranked subtype error
}

fn main() {}
8 changes: 8 additions & 0 deletions src/test/ui/higher-rank-trait-bounds/issue-59311.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: higher-ranked subtype error
--> $DIR/issue-59311.rs:13:9
|
LL | v.t(|| {});
| ^^^^^

error: aborting due to previous error