summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs
blob: a1f38e69e53ef8ccd54b6c4899b58513b26fc1a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// revisions: is_send not_send
// compile-flags: -Znext-solver
//[is_send] check-pass

#![feature(type_alias_impl_trait)]

#[cfg(is_send)]
type Foo = impl Send;

#[cfg(not_send)]
type Foo = impl Sized;

fn needs_send<T: Send>() {}

fn test(_: Foo) {
    needs_send::<Foo>();
    //[not_send]~^ ERROR type annotations needed: cannot satisfy `Foo: Send`
}

fn defines(_: Foo) {
    let _: Foo = ();
}

fn main() {}