@@ -19,9 +19,6 @@ use std::marker::Send;
19
19
20
20
struct Outer < T : Send > ( T ) ;
21
21
22
- struct TestType ;
23
- impl !Send for TestType { }
24
-
25
22
struct Outer2 < T > ( T ) ;
26
23
27
24
unsafe impl < T : Send > Sync for Outer2 < T > { }
@@ -30,29 +27,41 @@ fn is_send<T: Send>(_: T) {}
30
27
fn is_sync < T : Sync > ( _: T ) { }
31
28
32
29
fn dummy ( ) {
30
+ struct TestType ;
31
+ impl !Send for TestType { }
32
+
33
33
Outer ( TestType ) ;
34
- //~^ ERROR the trait `core::marker::Send` is not implemented for the type `TestType`
34
+ //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy:: TestType`
35
35
36
36
is_send ( TestType ) ;
37
- //~^ ERROR the trait `core::marker::Send` is not implemented for the type `TestType`
37
+ //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy:: TestType`
38
38
39
39
is_send ( ( 8 , TestType ) ) ;
40
- //~^ ERROR the trait `core::marker::Send` is not implemented for the type `TestType`
40
+ //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy:: TestType`
41
41
}
42
42
43
43
fn dummy2 ( ) {
44
+ struct TestType ;
45
+ impl !Send for TestType { }
46
+
44
47
is_send ( Box :: new ( TestType ) ) ;
45
- //~^ ERROR the trait `core::marker::Send` is not implemented for the type `TestType`
48
+ //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy2:: TestType`
46
49
}
47
50
48
51
fn dummy3 ( ) {
52
+ struct TestType ;
53
+ impl !Send for TestType { }
54
+
49
55
is_send ( Box :: new ( Outer2 ( TestType ) ) ) ;
50
- //~^ ERROR the trait `core::marker::Send` is not implemented for the type `TestType`
56
+ //~^ ERROR the trait `core::marker::Send` is not implemented for the type `dummy3:: TestType`
51
57
}
52
58
53
59
fn main ( ) {
60
+ struct TestType ;
61
+ impl !Send for TestType { }
62
+
54
63
// This will complain about a missing Send impl because `Sync` is implement *just*
55
64
// for T that are `Send`. Look at #20366 and #19950
56
65
is_sync ( Outer2 ( TestType ) ) ;
57
- //~^ ERROR the trait `core::marker::Send` is not implemented for the type `TestType`
66
+ //~^ ERROR the trait `core::marker::Send` is not implemented for the type `main:: TestType`
58
67
}
0 commit comments