rust/tests/ui/traits/next-solver/trait-upcast-lhs-needs-normalization.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
287 B
Rust
Raw Normal View History

2023-07-07 15:42:37 -05:00
// check-pass
2023-12-14 06:11:28 -06:00
// compile-flags: -Znext-solver
2023-07-07 15:42:37 -05:00
pub trait A {}
pub trait B: A {}
pub trait Mirror {
type Assoc: ?Sized;
}
impl<T: ?Sized> Mirror for T {
type Assoc = T;
}
pub fn foo<'a>(x: &'a <dyn B + 'static as Mirror>::Assoc) -> &'a (dyn A + 'static) {
x
}
fn main() {}