Skip to content

Commit

Permalink
Rollup merge of rust-lang#98684 - matthiaskrgr:ice-test-72793, r=oli-obk
Browse files Browse the repository at this point in the history
add test for 72793

Fixes rust-lang#72793

r? ````@oli-obk````
  • Loading branch information
matthiaskrgr committed Jun 30, 2022
2 parents 6ee6673 + afd8cf2 commit 7839890
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 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,25 @@
// check-pass
// compile-flags: -Zmir-opt-level=3

#![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 7839890

Please sign in to comment.