Files
rust/tests/ui/traits/next-solver/opaques/dont-remap-tait-substs.rs

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

21 lines
471 B
Rust
Raw Normal View History

2023-12-14 13:11:28 +01:00
//@ 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 {}
#[define_opaque(Foo)]
fn define<A, B: Send>(a: A, b: B) {
let y: Option<Foo<B, A>> = Some(b);
}
fn main() {}