Skip to content

Commit

Permalink
Rollup merge of rust-lang#75695 - JohnTitor:regression-test, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Add a regression test for issue-72793

Adds a regression test for rust-lang#72793, which is fixed by rust-lang#75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
  • Loading branch information
matklad authored Sep 4, 2020
2 parents b496a4b + 18ad5a5 commit 80877e3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/ui/type-alias-impl-trait/issue-72793.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// build-pass

// Regression test for #72793.
// FIXME: This still shows ICE with `-Zmir-opt-level=2`.

#![feature(type_alias_impl_trait)]

trait T { type Item; }

type Alias<'a> = impl T<Item = &'a ()>;

struct S;
impl<'a> T for &'a S {
type Item = &'a ();
}

fn filter_positive<'a>() -> Alias<'a> {
&S
}

fn with_positive(fun: impl Fn(Alias<'_>)) {
fun(filter_positive());
}

fn main() {
with_positive(|_| ());
}

0 comments on commit 80877e3

Please sign in to comment.