|
1 | | -error: some fields in `RingBuffer<T>` are not safe to be sent to another thread |
2 | | - --> $DIR/non_send_fields_in_send_ty.rs:17:1 |
3 | | - | |
4 | | -LL | unsafe impl<T> Send for RingBuffer<T> {} |
5 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
6 | | - | |
7 | | -note: it is not safe to send field `data` to another thread |
8 | | - --> $DIR/non_send_fields_in_send_ty.rs:12:5 |
9 | | - | |
10 | | -LL | data: Vec<UnsafeCell<T>>, |
11 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^ |
12 | | - = help: add bounds on type parameter `T` that satisfy `Vec<UnsafeCell<T>>: Send` |
13 | | - = note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings` |
14 | | - = help: to override `-D warnings` add `#[allow(clippy::non_send_fields_in_send_ty)]` |
15 | | - |
16 | | -error: some fields in `MvccRwLock<T>` are not safe to be sent to another thread |
17 | | - --> $DIR/non_send_fields_in_send_ty.rs:26:1 |
18 | | - | |
19 | | -LL | unsafe impl<T> Send for MvccRwLock<T> {} |
20 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
21 | | - | |
22 | | -note: it is not safe to send field `lock` to another thread |
23 | | - --> $DIR/non_send_fields_in_send_ty.rs:23:5 |
24 | | - | |
25 | | -LL | lock: Mutex<Box<T>>, |
26 | | - | ^^^^^^^^^^^^^^^^^^^ |
27 | | - = help: add bounds on type parameter `T` that satisfy `Mutex<Box<T>>: Send` |
28 | | - |
29 | | -error: some fields in `ArcGuard<RC, T>` are not safe to be sent to another thread |
30 | | - --> $DIR/non_send_fields_in_send_ty.rs:35:1 |
31 | | - | |
32 | | -LL | unsafe impl<RC, T: Send> Send for ArcGuard<RC, T> {} |
33 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
34 | | - | |
35 | | -note: it is not safe to send field `head` to another thread |
36 | | - --> $DIR/non_send_fields_in_send_ty.rs:32:5 |
37 | | - | |
38 | | -LL | head: Arc<RC>, |
39 | | - | ^^^^^^^^^^^^^ |
40 | | - = help: add bounds on type parameter `RC` that satisfy `Arc<RC>: Send` |
41 | | - |
42 | | -error: some fields in `DeviceHandle<T>` are not safe to be sent to another thread |
43 | | - --> $DIR/non_send_fields_in_send_ty.rs:52:1 |
44 | | - | |
45 | | -LL | unsafe impl<T: UsbContext> Send for DeviceHandle<T> {} |
46 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
47 | | - | |
48 | | -note: it is not safe to send field `context` to another thread |
49 | | - --> $DIR/non_send_fields_in_send_ty.rs:48:5 |
50 | | - | |
51 | | -LL | context: T, |
52 | | - | ^^^^^^^^^^ |
53 | | - = help: add `T: Send` bound in `Send` impl |
54 | | - |
55 | | -error: some fields in `NoGeneric` are not safe to be sent to another thread |
56 | | - --> $DIR/non_send_fields_in_send_ty.rs:60:1 |
57 | | - | |
58 | | -LL | unsafe impl Send for NoGeneric {} |
59 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
60 | | - | |
61 | | -note: it is not safe to send field `rc_is_not_send` to another thread |
62 | | - --> $DIR/non_send_fields_in_send_ty.rs:57:5 |
63 | | - | |
64 | | -LL | rc_is_not_send: Rc<String>, |
65 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
66 | | - = help: use a thread-safe type that implements `Send` |
67 | | - |
68 | | -error: some fields in `MultiField<T>` are not safe to be sent to another thread |
69 | | - --> $DIR/non_send_fields_in_send_ty.rs:69:1 |
70 | | - | |
71 | | -LL | unsafe impl<T> Send for MultiField<T> {} |
72 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
73 | | - | |
74 | | -note: it is not safe to send field `field1` to another thread |
75 | | - --> $DIR/non_send_fields_in_send_ty.rs:64:5 |
76 | | - | |
77 | | -LL | field1: T, |
78 | | - | ^^^^^^^^^ |
79 | | - = help: add `T: Send` bound in `Send` impl |
80 | | -note: it is not safe to send field `field2` to another thread |
81 | | - --> $DIR/non_send_fields_in_send_ty.rs:65:5 |
82 | | - | |
83 | | -LL | field2: T, |
84 | | - | ^^^^^^^^^ |
85 | | - = help: add `T: Send` bound in `Send` impl |
86 | | -note: it is not safe to send field `field3` to another thread |
87 | | - --> $DIR/non_send_fields_in_send_ty.rs:66:5 |
88 | | - | |
89 | | -LL | field3: T, |
90 | | - | ^^^^^^^^^ |
91 | | - = help: add `T: Send` bound in `Send` impl |
92 | | - |
93 | | -error: some fields in `MyOption<T>` are not safe to be sent to another thread |
94 | | - --> $DIR/non_send_fields_in_send_ty.rs:77:1 |
95 | | - | |
96 | | -LL | unsafe impl<T> Send for MyOption<T> {} |
97 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
98 | | - | |
99 | | -note: it is not safe to send field `0` to another thread |
100 | | - --> $DIR/non_send_fields_in_send_ty.rs:73:12 |
101 | | - | |
102 | | -LL | MySome(T), |
103 | | - | ^ |
104 | | - = help: add `T: Send` bound in `Send` impl |
105 | | - |
106 | | -error: some fields in `MultiParam<A, B>` are not safe to be sent to another thread |
107 | | - --> $DIR/non_send_fields_in_send_ty.rs:90:1 |
108 | | - | |
109 | | -LL | unsafe impl<A, B> Send for MultiParam<A, B> {} |
110 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
111 | | - | |
112 | | -note: it is not safe to send field `vec` to another thread |
113 | | - --> $DIR/non_send_fields_in_send_ty.rs:87:5 |
114 | | - | |
115 | | -LL | vec: Vec<(A, B)>, |
116 | | - | ^^^^^^^^^^^^^^^^ |
117 | | - = help: add bounds on type parameters `A, B` that satisfy `Vec<(A, B)>: Send` |
118 | | - |
119 | | -error: some fields in `HeuristicTest` are not safe to be sent to another thread |
120 | | - --> $DIR/non_send_fields_in_send_ty.rs:109:1 |
121 | | - | |
122 | | -LL | unsafe impl Send for HeuristicTest {} |
123 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
124 | | - | |
125 | | -note: it is not safe to send field `field4` to another thread |
126 | | - --> $DIR/non_send_fields_in_send_ty.rs:104:5 |
127 | | - | |
128 | | -LL | field4: (*const NonSend, Rc<u8>), |
129 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
130 | | - = help: use a thread-safe type that implements `Send` |
131 | | - |
132 | | -error: some fields in `AttrTest3<T>` are not safe to be sent to another thread |
133 | | - --> $DIR/non_send_fields_in_send_ty.rs:129:1 |
134 | | - | |
135 | | -LL | unsafe impl<T> Send for AttrTest3<T> {} |
136 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
137 | | - | |
138 | | -note: it is not safe to send field `0` to another thread |
139 | | - --> $DIR/non_send_fields_in_send_ty.rs:124:11 |
140 | | - | |
141 | | -LL | Enum2(T), |
142 | | - | ^ |
143 | | - = help: add `T: Send` bound in `Send` impl |
144 | | - |
145 | | -error: some fields in `Complex<P, u32>` are not safe to be sent to another thread |
146 | | - --> $DIR/non_send_fields_in_send_ty.rs:138:1 |
| 1 | +error: cross-crate traits with a default impl, like `std::marker::Send`, should not be specialized |
| 2 | + --> $DIR/non_send_fields_in_send_ty.rs:137:1 |
147 | 3 | | |
148 | 4 | LL | unsafe impl<P> Send for Complex<P, u32> {} |
149 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
150 | 6 | | |
151 | | -note: it is not safe to send field `field1` to another thread |
152 | | - --> $DIR/non_send_fields_in_send_ty.rs:134:5 |
| 7 | + = note: `u32` is not a generic parameter |
| 8 | +note: try using the same sequence of generic parameters as the struct definition |
| 9 | + --> $DIR/non_send_fields_in_send_ty.rs:132:1 |
153 | 10 | | |
154 | | -LL | field1: A, |
155 | | - | ^^^^^^^^^ |
156 | | - = help: add `P: Send` bound in `Send` impl |
| 11 | +LL | pub struct Complex<A, B> { |
| 12 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ |
157 | 13 |
|
158 | | -error: some fields in `Complex<Q, MutexGuard<'static, bool>>` are not safe to be sent to another thread |
159 | | - --> $DIR/non_send_fields_in_send_ty.rs:142:1 |
| 14 | +error: cross-crate traits with a default impl, like `std::marker::Send`, should not be specialized |
| 15 | + --> $DIR/non_send_fields_in_send_ty.rs:141:1 |
160 | 16 | | |
161 | 17 | LL | unsafe impl<Q: Send> Send for Complex<Q, MutexGuard<'static, bool>> {} |
162 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 18 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
163 | 19 | | |
164 | | -note: it is not safe to send field `field2` to another thread |
165 | | - --> $DIR/non_send_fields_in_send_ty.rs:135:5 |
| 20 | + = note: `std::sync::MutexGuard<'static, bool>` is not a generic parameter |
| 21 | +note: try using the same sequence of generic parameters as the struct definition |
| 22 | + --> $DIR/non_send_fields_in_send_ty.rs:132:1 |
166 | 23 | | |
167 | | -LL | field2: B, |
168 | | - | ^^^^^^^^^ |
169 | | - = help: use a thread-safe type that implements `Send` |
| 24 | +LL | pub struct Complex<A, B> { |
| 25 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ |
170 | 26 |
|
171 | | -error: aborting due to 12 previous errors |
| 27 | +error: aborting due to 2 previous errors |
172 | 28 |
|
0 commit comments