Skip to content

Commit 94b0a7b

Browse files
committed
silence lint in clippy
1 parent ea62469 commit 94b0a7b

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

Diff for: src/tools/clippy/tests/ui/non_send_fields_in_send_ty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::non_send_fields_in_send_ty)]
2+
#![allow(suspicious_auto_trait_impls)]
23
#![feature(extern_types)]
34

45
use std::cell::UnsafeCell;

Diff for: src/tools/clippy/tests/ui/non_send_fields_in_send_ty.stderr

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,167 @@
11
error: some fields in `RingBuffer<T>` are not safe to be sent to another thread
2-
--> $DIR/non_send_fields_in_send_ty.rs:16:1
2+
--> $DIR/non_send_fields_in_send_ty.rs:17:1
33
|
44
LL | unsafe impl<T> Send for RingBuffer<T> {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings`
88
note: it is not safe to send field `data` to another thread
9-
--> $DIR/non_send_fields_in_send_ty.rs:11:5
9+
--> $DIR/non_send_fields_in_send_ty.rs:12:5
1010
|
1111
LL | data: Vec<UnsafeCell<T>>,
1212
| ^^^^^^^^^^^^^^^^^^^^^^^^
1313
= help: add bounds on type parameter `T` that satisfy `Vec<UnsafeCell<T>>: Send`
1414

1515
error: some fields in `MvccRwLock<T>` are not safe to be sent to another thread
16-
--> $DIR/non_send_fields_in_send_ty.rs:24:1
16+
--> $DIR/non_send_fields_in_send_ty.rs:25:1
1717
|
1818
LL | unsafe impl<T> Send for MvccRwLock<T> {}
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020
|
2121
note: it is not safe to send field `lock` to another thread
22-
--> $DIR/non_send_fields_in_send_ty.rs:21:5
22+
--> $DIR/non_send_fields_in_send_ty.rs:22:5
2323
|
2424
LL | lock: Mutex<Box<T>>,
2525
| ^^^^^^^^^^^^^^^^^^^
2626
= help: add bounds on type parameter `T` that satisfy `Mutex<Box<T>>: Send`
2727

2828
error: some fields in `ArcGuard<RC, T>` are not safe to be sent to another thread
29-
--> $DIR/non_send_fields_in_send_ty.rs:32:1
29+
--> $DIR/non_send_fields_in_send_ty.rs:33:1
3030
|
3131
LL | unsafe impl<RC, T: Send> Send for ArcGuard<RC, T> {}
3232
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3333
|
3434
note: it is not safe to send field `head` to another thread
35-
--> $DIR/non_send_fields_in_send_ty.rs:29:5
35+
--> $DIR/non_send_fields_in_send_ty.rs:30:5
3636
|
3737
LL | head: Arc<RC>,
3838
| ^^^^^^^^^^^^^
3939
= help: add bounds on type parameter `RC` that satisfy `Arc<RC>: Send`
4040

4141
error: some fields in `DeviceHandle<T>` are not safe to be sent to another thread
42-
--> $DIR/non_send_fields_in_send_ty.rs:48:1
42+
--> $DIR/non_send_fields_in_send_ty.rs:49:1
4343
|
4444
LL | unsafe impl<T: UsbContext> Send for DeviceHandle<T> {}
4545
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4646
|
4747
note: it is not safe to send field `context` to another thread
48-
--> $DIR/non_send_fields_in_send_ty.rs:44:5
48+
--> $DIR/non_send_fields_in_send_ty.rs:45:5
4949
|
5050
LL | context: T,
5151
| ^^^^^^^^^^
5252
= help: add `T: Send` bound in `Send` impl
5353

5454
error: some fields in `NoGeneric` are not safe to be sent to another thread
55-
--> $DIR/non_send_fields_in_send_ty.rs:55:1
55+
--> $DIR/non_send_fields_in_send_ty.rs:56:1
5656
|
5757
LL | unsafe impl Send for NoGeneric {}
5858
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5959
|
6060
note: it is not safe to send field `rc_is_not_send` to another thread
61-
--> $DIR/non_send_fields_in_send_ty.rs:52:5
61+
--> $DIR/non_send_fields_in_send_ty.rs:53:5
6262
|
6363
LL | rc_is_not_send: Rc<String>,
6464
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
6565
= help: use a thread-safe type that implements `Send`
6666

6767
error: some fields in `MultiField<T>` are not safe to be sent to another thread
68-
--> $DIR/non_send_fields_in_send_ty.rs:63:1
68+
--> $DIR/non_send_fields_in_send_ty.rs:64:1
6969
|
7070
LL | unsafe impl<T> Send for MultiField<T> {}
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7272
|
7373
note: it is not safe to send field `field1` to another thread
74-
--> $DIR/non_send_fields_in_send_ty.rs:58:5
74+
--> $DIR/non_send_fields_in_send_ty.rs:59:5
7575
|
7676
LL | field1: T,
7777
| ^^^^^^^^^
7878
= help: add `T: Send` bound in `Send` impl
7979
note: it is not safe to send field `field2` to another thread
80-
--> $DIR/non_send_fields_in_send_ty.rs:59:5
80+
--> $DIR/non_send_fields_in_send_ty.rs:60:5
8181
|
8282
LL | field2: T,
8383
| ^^^^^^^^^
8484
= help: add `T: Send` bound in `Send` impl
8585
note: it is not safe to send field `field3` to another thread
86-
--> $DIR/non_send_fields_in_send_ty.rs:60:5
86+
--> $DIR/non_send_fields_in_send_ty.rs:61:5
8787
|
8888
LL | field3: T,
8989
| ^^^^^^^^^
9090
= help: add `T: Send` bound in `Send` impl
9191

9292
error: some fields in `MyOption<T>` are not safe to be sent to another thread
93-
--> $DIR/non_send_fields_in_send_ty.rs:70:1
93+
--> $DIR/non_send_fields_in_send_ty.rs:71:1
9494
|
9595
LL | unsafe impl<T> Send for MyOption<T> {}
9696
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9797
|
9898
note: it is not safe to send field `0` to another thread
99-
--> $DIR/non_send_fields_in_send_ty.rs:66:12
99+
--> $DIR/non_send_fields_in_send_ty.rs:67:12
100100
|
101101
LL | MySome(T),
102102
| ^
103103
= help: add `T: Send` bound in `Send` impl
104104

105105
error: some fields in `MultiParam<A, B>` are not safe to be sent to another thread
106-
--> $DIR/non_send_fields_in_send_ty.rs:82:1
106+
--> $DIR/non_send_fields_in_send_ty.rs:83:1
107107
|
108108
LL | unsafe impl<A, B> Send for MultiParam<A, B> {}
109109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110110
|
111111
note: it is not safe to send field `vec` to another thread
112-
--> $DIR/non_send_fields_in_send_ty.rs:79:5
112+
--> $DIR/non_send_fields_in_send_ty.rs:80:5
113113
|
114114
LL | vec: Vec<(A, B)>,
115115
| ^^^^^^^^^^^^^^^^
116116
= help: add bounds on type parameters `A, B` that satisfy `Vec<(A, B)>: Send`
117117

118118
error: some fields in `HeuristicTest` are not safe to be sent to another thread
119-
--> $DIR/non_send_fields_in_send_ty.rs:100:1
119+
--> $DIR/non_send_fields_in_send_ty.rs:101:1
120120
|
121121
LL | unsafe impl Send for HeuristicTest {}
122122
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123123
|
124124
note: it is not safe to send field `field4` to another thread
125-
--> $DIR/non_send_fields_in_send_ty.rs:95:5
125+
--> $DIR/non_send_fields_in_send_ty.rs:96:5
126126
|
127127
LL | field4: (*const NonSend, Rc<u8>),
128128
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129129
= help: use a thread-safe type that implements `Send`
130130

131131
error: some fields in `AttrTest3<T>` are not safe to be sent to another thread
132-
--> $DIR/non_send_fields_in_send_ty.rs:119:1
132+
--> $DIR/non_send_fields_in_send_ty.rs:120:1
133133
|
134134
LL | unsafe impl<T> Send for AttrTest3<T> {}
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136136
|
137137
note: it is not safe to send field `0` to another thread
138-
--> $DIR/non_send_fields_in_send_ty.rs:114:11
138+
--> $DIR/non_send_fields_in_send_ty.rs:115:11
139139
|
140140
LL | Enum2(T),
141141
| ^
142142
= help: add `T: Send` bound in `Send` impl
143143

144144
error: some fields in `Complex<P, u32>` are not safe to be sent to another thread
145-
--> $DIR/non_send_fields_in_send_ty.rs:127:1
145+
--> $DIR/non_send_fields_in_send_ty.rs:128:1
146146
|
147147
LL | unsafe impl<P> Send for Complex<P, u32> {}
148148
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
149149
|
150150
note: it is not safe to send field `field1` to another thread
151-
--> $DIR/non_send_fields_in_send_ty.rs:123:5
151+
--> $DIR/non_send_fields_in_send_ty.rs:124:5
152152
|
153153
LL | field1: A,
154154
| ^^^^^^^^^
155155
= help: add `P: Send` bound in `Send` impl
156156

157157
error: some fields in `Complex<Q, MutexGuard<'static, bool>>` are not safe to be sent to another thread
158-
--> $DIR/non_send_fields_in_send_ty.rs:130:1
158+
--> $DIR/non_send_fields_in_send_ty.rs:131:1
159159
|
160160
LL | unsafe impl<Q: Send> Send for Complex<Q, MutexGuard<'static, bool>> {}
161161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
162162
|
163163
note: it is not safe to send field `field2` to another thread
164-
--> $DIR/non_send_fields_in_send_ty.rs:124:5
164+
--> $DIR/non_send_fields_in_send_ty.rs:125:5
165165
|
166166
LL | field2: B,
167167
| ^^^^^^^^^

0 commit comments

Comments
 (0)