summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/next-solver/dont-remap-tait-substs.rs
blob: b089f0df3c78623033b76b56a9796b21572c6d59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// compile-flags: -Znext-solver
// check-pass

// Makes sure we don't prepopulate the MIR typeck of `define`
// with `Foo<T, U> = T`, but instead, `Foo<B, A> = B`, so that
// the param-env predicates actually apply.

#![feature(type_alias_impl_trait)]

type Foo<T: Send, U> = impl NeedsSend<T>;

trait NeedsSend<T> {}
impl<T: Send> NeedsSend<T> for T {}

fn define<A, B: Send>(a: A, b: B, _: Foo<B, A>) {
    let y: Option<Foo<B, A>> = Some(b);
}

fn main() {}