Skip to content

Commit

Permalink
Add regression test for #86351
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
  • Loading branch information
JohnTitor committed Apr 5, 2023
1 parent 90a9f69 commit b8e9076
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/ui/const_prop/issue-86351.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// compile-flags: --crate-type=lib -Zmir-opt-level=2
// build-pass
// ^-- Must be build-pass, because check-pass will not run const prop.

pub trait TestTrait {
type MyType;
fn func() -> Option<Self>
where
Self: Sized;
}

impl<T> dyn TestTrait<MyType = T>
where
Self: Sized,
{
pub fn other_func() -> Option<Self> {
match Self::func() {
Some(me) => Some(me),
None => None,
}
}
}

0 comments on commit b8e9076

Please sign in to comment.