You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#115311 - dtolnay:usearcself, r=compiler-errors
Revert "Suggest using `Arc` on `!Send`/`!Sync` types"
Closesrust-lang#114687. This is a clean revert of rust-lang#88936 + rust-lang#115210. The suggestion to Arc\<{Self}\> when Self does not implement Send is *always* wrong.
rust-lang#114842 is considering a way to make a more refined suggestion.
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
6
6
|
7
7
= help: the trait `Send` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
8
-
= note: consider using `std::sync::Arc<<<Self as Case1>::C as Iterator>::Item>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
9
8
help: consider further restricting the associated type
10
9
|
11
10
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
31
30
|
32
31
= help: the trait `Sync` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
33
-
= note: consider using `std::sync::Arc<<<Self as Case1>::C as Iterator>::Item>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
34
32
help: consider further restricting the associated type
35
33
|
36
34
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync {
Copy file name to clipboardExpand all lines: tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr
-1
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,6 @@ LL | is_send(foo::<T>());
14
14
| ^^^^^^^^^^ future returned by `foo` is not `Send`
15
15
|
16
16
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>>`
17
-
= note: consider using `std::sync::Arc<impl Future<Output = Result<(), ()>>>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
18
17
note: future is not `Send` as it awaits another future which is not `Send`
Copy file name to clipboardExpand all lines: tests/ui/async-await/in-trait/missing-send-bound.stderr
-1
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,6 @@ LL | assert_is_send(test::<T>());
5
5
| ^^^^^^^^^^^ future returned by `test` is not `Send`
6
6
|
7
7
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
8
-
= note: consider using `std::sync::Arc<impl Future<Output = ()>>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
9
8
note: future is not `Send` as it awaits another future which is not `Send`
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
6
6
|
7
7
= help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)`
8
-
= note: consider using `std::sync::Arc<(dyn Any + Send + 'static)>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
9
8
note: future is not `Send` as this value is used across an await
0 commit comments