about summary refs log tree commit diff
path: root/tests/ui/coherence/orphan-check-projections-covering.rs
blob: 804784463a1b591da55fa1364758ded7fd635062 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Projections cover type parameters if they normalize to a (local) type that covers them.
// This ensures that we don't perform an overly strict check on
// projections like in closed PR #100555 which did a syntactic
// check for type parameters in projections without normalizing
// first which would've lead to real-word regressions.

//@ check-pass
//@ aux-crate:foreign=parametrized-trait.rs
//@ edition:2021

trait Project { type Output; }

impl<T> Project for Wrapper<T> {
    type Output = Local;
}

struct Wrapper<T>(T);
struct Local;

impl<T> foreign::Trait1<Local, T> for <Wrapper<T> as Project>::Output {}

fn main() {}