-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2a96c7
commit ac045b0
Showing
23 changed files
with
184 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
178 changes: 17 additions & 161 deletions
178
src/tools/clippy/tests/ui/non_send_fields_in_send_ty.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,172 +1,28 @@ | ||
error: some fields in `RingBuffer<T>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:17:1 | ||
| | ||
LL | unsafe impl<T> Send for RingBuffer<T> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `data` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:12:5 | ||
| | ||
LL | data: Vec<UnsafeCell<T>>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= help: add bounds on type parameter `T` that satisfy `Vec<UnsafeCell<T>>: Send` | ||
= note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::non_send_fields_in_send_ty)]` | ||
|
||
error: some fields in `MvccRwLock<T>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:26:1 | ||
| | ||
LL | unsafe impl<T> Send for MvccRwLock<T> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `lock` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:23:5 | ||
| | ||
LL | lock: Mutex<Box<T>>, | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
= help: add bounds on type parameter `T` that satisfy `Mutex<Box<T>>: Send` | ||
|
||
error: some fields in `ArcGuard<RC, T>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:35:1 | ||
| | ||
LL | unsafe impl<RC, T: Send> Send for ArcGuard<RC, T> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `head` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:32:5 | ||
| | ||
LL | head: Arc<RC>, | ||
| ^^^^^^^^^^^^^ | ||
= help: add bounds on type parameter `RC` that satisfy `Arc<RC>: Send` | ||
|
||
error: some fields in `DeviceHandle<T>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:52:1 | ||
| | ||
LL | unsafe impl<T: UsbContext> Send for DeviceHandle<T> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `context` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:48:5 | ||
| | ||
LL | context: T, | ||
| ^^^^^^^^^^ | ||
= help: add `T: Send` bound in `Send` impl | ||
|
||
error: some fields in `NoGeneric` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:60:1 | ||
| | ||
LL | unsafe impl Send for NoGeneric {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `rc_is_not_send` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:57:5 | ||
| | ||
LL | rc_is_not_send: Rc<String>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= help: use a thread-safe type that implements `Send` | ||
|
||
error: some fields in `MultiField<T>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:69:1 | ||
| | ||
LL | unsafe impl<T> Send for MultiField<T> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `field1` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:64:5 | ||
| | ||
LL | field1: T, | ||
| ^^^^^^^^^ | ||
= help: add `T: Send` bound in `Send` impl | ||
note: it is not safe to send field `field2` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:65:5 | ||
| | ||
LL | field2: T, | ||
| ^^^^^^^^^ | ||
= help: add `T: Send` bound in `Send` impl | ||
note: it is not safe to send field `field3` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:66:5 | ||
| | ||
LL | field3: T, | ||
| ^^^^^^^^^ | ||
= help: add `T: Send` bound in `Send` impl | ||
|
||
error: some fields in `MyOption<T>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:77:1 | ||
| | ||
LL | unsafe impl<T> Send for MyOption<T> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `0` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:73:12 | ||
| | ||
LL | MySome(T), | ||
| ^ | ||
= help: add `T: Send` bound in `Send` impl | ||
|
||
error: some fields in `MultiParam<A, B>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:90:1 | ||
| | ||
LL | unsafe impl<A, B> Send for MultiParam<A, B> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `vec` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:87:5 | ||
| | ||
LL | vec: Vec<(A, B)>, | ||
| ^^^^^^^^^^^^^^^^ | ||
= help: add bounds on type parameters `A, B` that satisfy `Vec<(A, B)>: Send` | ||
|
||
error: some fields in `HeuristicTest` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:109:1 | ||
| | ||
LL | unsafe impl Send for HeuristicTest {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `field4` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:104:5 | ||
| | ||
LL | field4: (*const NonSend, Rc<u8>), | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= help: use a thread-safe type that implements `Send` | ||
|
||
error: some fields in `AttrTest3<T>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:129:1 | ||
| | ||
LL | unsafe impl<T> Send for AttrTest3<T> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `0` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:124:11 | ||
| | ||
LL | Enum2(T), | ||
| ^ | ||
= help: add `T: Send` bound in `Send` impl | ||
|
||
error: some fields in `Complex<P, u32>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:138:1 | ||
error: cross-crate traits with a default impl, like `std::marker::Send`, should not be specialized | ||
--> $DIR/non_send_fields_in_send_ty.rs:137:1 | ||
| | ||
LL | unsafe impl<P> Send for Complex<P, u32> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `field1` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:134:5 | ||
= note: `u32` is not a generic parameter | ||
note: try using the same sequence of generic parameters as the struct definition | ||
--> $DIR/non_send_fields_in_send_ty.rs:132:1 | ||
| | ||
LL | field1: A, | ||
| ^^^^^^^^^ | ||
= help: add `P: Send` bound in `Send` impl | ||
LL | pub struct Complex<A, B> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: some fields in `Complex<Q, MutexGuard<'static, bool>>` are not safe to be sent to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:142:1 | ||
error: cross-crate traits with a default impl, like `std::marker::Send`, should not be specialized | ||
--> $DIR/non_send_fields_in_send_ty.rs:141:1 | ||
| | ||
LL | unsafe impl<Q: Send> Send for Complex<Q, MutexGuard<'static, bool>> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: it is not safe to send field `field2` to another thread | ||
--> $DIR/non_send_fields_in_send_ty.rs:135:5 | ||
= note: `std::sync::MutexGuard<'static, bool>` is not a generic parameter | ||
note: try using the same sequence of generic parameters as the struct definition | ||
--> $DIR/non_send_fields_in_send_ty.rs:132:1 | ||
| | ||
LL | field2: B, | ||
| ^^^^^^^^^ | ||
= help: use a thread-safe type that implements `Send` | ||
LL | pub struct Complex<A, B> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 12 previous errors | ||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.