Skip to content

Commit

Permalink
Add a regression test for issue-72793
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Aug 19, 2020
1 parent c03c213 commit 18ad5a5
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 18ad5a5

Please sign in to comment.