The ICE fix appears to be unsound, causing a miscompilation involving
`dyn Trait` and `async {}` which induces segfaults in safe Rust code.
As the patch only hid an ICE, it does not seem worth the risk.
This reverts commit 8afd63610b, reversing
changes made to 19122c03c7.
18 lines
325 B
Rust
18 lines
325 B
Rust
//@ known-bug: #137190
|
|
trait Supertrait<T> {
|
|
fn method(&self) {}
|
|
}
|
|
|
|
trait Trait<P>: Supertrait<()> {}
|
|
|
|
impl<P> Trait<P> for () {}
|
|
|
|
const fn upcast<P>(x: &dyn Trait<P>) -> &dyn Supertrait<()> {
|
|
x
|
|
}
|
|
|
|
const fn foo() -> &'static dyn Supertrait<()> {
|
|
upcast::<()>(&())
|
|
}
|
|
|
|
const _: &'static dyn Supertrait<()> = foo();
|