Rollup merge of #75695 - JohnTitor:regression-test, r=Dylan-DPC
Add a regression test for issue-72793 Adds a regression test for #72793, which is fixed by #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.
This commit is contained in:
commit
cb33a15c3e
27
src/test/ui/type-alias-impl-trait/issue-72793.rs
Normal file
27
src/test/ui/type-alias-impl-trait/issue-72793.rs
Normal file
@ -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(|_| ());
|
||||
}
|
Loading…
Reference in New Issue
Block a user