diff options
Diffstat (limited to 'tests/ui/traits/next-solver/supertrait-alias-1.rs')
| -rw-r--r-- | tests/ui/traits/next-solver/supertrait-alias-1.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/traits/next-solver/supertrait-alias-1.rs b/tests/ui/traits/next-solver/supertrait-alias-1.rs new file mode 100644 index 00000000000..579a44677c2 --- /dev/null +++ b/tests/ui/traits/next-solver/supertrait-alias-1.rs @@ -0,0 +1,22 @@ +//@ compile-flags: -Znext-solver +//@ check-pass + +// Regression test for <https://github.com/rust-lang/trait-system-refactor-initiative/issues/171>. +// Tests that we don't try to replace `<V as Super>::Output` when replacing projections in the +// required bounds for `dyn Trait`, b/c `V` is not relevant to the dyn type, which we were +// previously encountering b/c we were walking into the existential projection bounds of the dyn +// type itself. + +pub trait Trait: Super {} + +pub trait Super { + type Output; +} + +fn bound<T: Trait + ?Sized>() {} + +fn visit_simd_operator<V: Super + ?Sized>() { + bound::<dyn Trait<Output = <V as Super>::Output>>(); +} + +fn main() {} |
