summaryrefslogtreecommitdiffstats
path: root/src/test/ui/extern/extern-type-diag-not-similar.rs
blob: 39d00a6c1bc31c11bf0fde0f7a61bd9983ab7e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// We previously mentioned other extern types in the error message here.
//
// Two extern types shouldn't really be considered similar just
// because they are both extern types.

#![feature(extern_types)]
extern {
    type ShouldNotBeMentioned;
}

extern {
    type Foo;
}

unsafe impl Send for ShouldNotBeMentioned {}

fn assert_send<T: Send + ?Sized>() {}

fn main() {
    assert_send::<Foo>()
    //~^ ERROR `Foo` cannot be sent between threads safely
}