Skip to content

Commit fe20ae0

Browse files
authored
Rollup merge of #109969 - JohnTitor:issue-86351, r=compiler-errors
Add regression test for #86351 r? `@compiler-errors` Closes #86351
2 parents 1424268 + b8e9076 commit fe20ae0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/ui/const_prop/issue-86351.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// compile-flags: --crate-type=lib -Zmir-opt-level=2
2+
// build-pass
3+
// ^-- Must be build-pass, because check-pass will not run const prop.
4+
5+
pub trait TestTrait {
6+
type MyType;
7+
fn func() -> Option<Self>
8+
where
9+
Self: Sized;
10+
}
11+
12+
impl<T> dyn TestTrait<MyType = T>
13+
where
14+
Self: Sized,
15+
{
16+
pub fn other_func() -> Option<Self> {
17+
match Self::func() {
18+
Some(me) => Some(me),
19+
None => None,
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)