Skip to content

Commit 9b0abe3

Browse files
authored
Rollup merge of rust-lang#115311 - dtolnay:usearcself, r=compiler-errors
Revert "Suggest using `Arc` on `!Send`/`!Sync` types" Closes rust-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.
2 parents 2eff0de + 823bacb commit 9b0abe3

File tree

113 files changed

+13
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+13
-225
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

-6
Original file line numberDiff line numberDiff line change
@@ -2743,12 +2743,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
27432743
}
27442744
ObligationCauseCode::BindingObligation(item_def_id, span)
27452745
| ObligationCauseCode::ExprBindingObligation(item_def_id, span, ..) => {
2746-
if self.tcx.is_diagnostic_item(sym::Send, item_def_id)
2747-
|| self.tcx.lang_items().sync_trait() == Some(item_def_id)
2748-
{
2749-
return;
2750-
}
2751-
27522746
let item_name = tcx.def_path_str(item_def_id);
27532747
let short_item_name = with_forced_trimmed_paths!(tcx.def_path_str(item_def_id));
27542748
let mut multispan = MultiSpan::from(span);

library/core/src/marker.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,8 @@ macro marker_impls {
7676
#[stable(feature = "rust1", since = "1.0.0")]
7777
#[cfg_attr(not(test), rustc_diagnostic_item = "Send")]
7878
#[rustc_on_unimplemented(
79-
on(_Self = "std::rc::Rc<T, A>", note = "use `std::sync::Arc` instead of `std::rc::Rc`"),
80-
on(_Self = "alloc::rc::Rc<T, A>", note = "use `alloc::sync::Arc` instead of `alloc::rc::Rc`"),
8179
message = "`{Self}` cannot be sent between threads safely",
82-
label = "`{Self}` cannot be sent between threads safely",
83-
note = "consider using `std::sync::Arc<{Self}>`; for more information visit \
84-
<https://doc.rust-lang.org/book/ch16-03-shared-state.html>"
80+
label = "`{Self}` cannot be sent between threads safely"
8581
)]
8682
pub unsafe auto trait Send {
8783
// empty.
@@ -632,12 +628,8 @@ impl<T: ?Sized> Copy for &T {}
632628
any(_Self = "core::cell::RefCell<T>", _Self = "std::cell::RefCell<T>"),
633629
note = "if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead",
634630
),
635-
on(_Self = "std::rc::Rc<T, A>", note = "use `std::sync::Arc` instead of `std::rc::Rc`"),
636-
on(_Self = "alloc::rc::Rc<T, A>", note = "use `alloc::sync::Arc` instead of `alloc::rc::Rc`"),
637631
message = "`{Self}` cannot be shared between threads safely",
638-
label = "`{Self}` cannot be shared between threads safely",
639-
note = "consider using `std::sync::Arc<{Self}>`; for more information visit \
640-
<https://doc.rust-lang.org/book/ch16-03-shared-state.html>"
632+
label = "`{Self}` cannot be shared between threads safely"
641633
)]
642634
pub unsafe auto trait Sync {
643635
// FIXME(estebank): once support to add notes in `rustc_on_unimplemented`

tests/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8
55
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
66
|
77
= 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>
98
help: consider further restricting the associated type
109
|
1110
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
@@ -30,7 +29,6 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8
3029
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
3130
|
3231
= 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>
3432
help: consider further restricting the associated type
3533
|
3634
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync {

tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ LL | is_send(foo::<T>());
1414
| ^^^^^^^^^^ future returned by `foo` is not `Send`
1515
|
1616
= 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>
1817
note: future is not `Send` as it awaits another future which is not `Send`
1918
--> $DIR/basic.rs:13:5
2019
|

tests/ui/async-await/async-await-let-else.drop_tracking.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | is_send(foo(Some(true)));
55
| ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/async-await-let-else.rs:11:15
1110
|
@@ -33,7 +32,6 @@ LL | is_send(foo2(Some(true)));
3332
| required by a bound introduced by this call
3433
|
3534
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
36-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
3735
note: required because it's used within this `async fn` body
3836
--> $DIR/async-await-let-else.rs:27:29
3937
|
@@ -66,7 +64,6 @@ LL | is_send(foo3(Some(true)));
6664
| ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send`
6765
|
6866
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
69-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
7067
note: future is not `Send` as this value is used across an await
7168
--> $DIR/async-await-let-else.rs:33:29
7269
|
@@ -88,7 +85,6 @@ LL | is_send(foo4(Some(true)));
8885
| ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send`
8986
|
9087
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
91-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
9288
note: future is not `Send` as this value is used across an await
9389
--> $DIR/async-await-let-else.rs:41:15
9490
|

tests/ui/async-await/async-await-let-else.drop_tracking_mir.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | is_send(foo(Some(true)));
55
| ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/async-await-let-else.rs:11:15
1110
|
@@ -31,7 +30,6 @@ LL | is_send(foo2(Some(true)));
3130
| required by a bound introduced by this call
3231
|
3332
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
34-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
3533
note: required because it's used within this `async fn` body
3634
--> $DIR/async-await-let-else.rs:27:29
3735
|
@@ -64,7 +62,6 @@ LL | is_send(foo3(Some(true)));
6462
| ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send`
6563
|
6664
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
67-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
6865
note: future is not `Send` as this value is used across an await
6966
--> $DIR/async-await-let-else.rs:33:29
7067
|
@@ -85,7 +82,6 @@ LL | is_send(foo4(Some(true)));
8582
| ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send`
8683
|
8784
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
88-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
8985
note: future is not `Send` as this value is used across an await
9086
--> $DIR/async-await-let-else.rs:41:15
9187
|

tests/ui/async-await/async-await-let-else.no_drop_tracking.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | is_send(foo(Some(true)));
55
| ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/async-await-let-else.rs:11:15
1110
|
@@ -28,7 +27,6 @@ LL | is_send(foo2(Some(true)));
2827
| ^^^^^^^^^^^^^^^^ future returned by `foo2` is not `Send`
2928
|
3029
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
31-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
3230
note: future is not `Send` as this value is used across an await
3331
--> $DIR/async-await-let-else.rs:23:27
3432
|
@@ -51,7 +49,6 @@ LL | is_send(foo3(Some(true)));
5149
| ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send`
5250
|
5351
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
54-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
5552
note: future is not `Send` as this value is used across an await
5653
--> $DIR/async-await-let-else.rs:33:29
5754
|
@@ -73,7 +70,6 @@ LL | is_send(foo4(Some(true)));
7370
| ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send`
7471
|
7572
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
76-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
7773
note: future is not `Send` as this value is used across an await
7874
--> $DIR/async-await-let-else.rs:41:15
7975
|

tests/ui/async-await/async-fn-nonsend.drop_tracking.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(non_send_temporary_in_match());
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/async-fn-nonsend.rs:36:26
1110
|
@@ -29,7 +28,6 @@ LL | assert_send(non_sync_with_method_call());
2928
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
3029
|
3130
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
32-
= note: consider using `std::sync::Arc<dyn std::fmt::Write>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
3331
note: future is not `Send` as this value is used across an await
3432
--> $DIR/async-fn-nonsend.rs:49:15
3533
|

tests/ui/async-await/async-fn-nonsend.drop_tracking_mir.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(non_send_temporary_in_match());
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/async-fn-nonsend.rs:36:26
1110
|
@@ -26,7 +25,6 @@ LL | assert_send(non_sync_with_method_call());
2625
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
2726
|
2827
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
29-
= note: consider using `std::sync::Arc<dyn std::fmt::Write>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
3028
note: future is not `Send` as this value is used across an await
3129
--> $DIR/async-fn-nonsend.rs:49:15
3230
|

tests/ui/async-await/async-fn-nonsend.no_drop_tracking.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(local_dropped_before_await());
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `local_dropped_before_await` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/async-fn-nonsend.rs:27:11
1110
|
@@ -29,7 +28,6 @@ LL | assert_send(non_send_temporary_in_match());
2928
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
3029
|
3130
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
32-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
3331
note: future is not `Send` as this value is used across an await
3432
--> $DIR/async-fn-nonsend.rs:36:26
3533
|
@@ -53,7 +51,6 @@ LL | assert_send(non_sync_with_method_call());
5351
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
5452
|
5553
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
56-
= note: consider using `std::sync::Arc<dyn std::fmt::Write>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
5754
note: future is not `Send` as this value is used across an await
5855
--> $DIR/async-fn-nonsend.rs:49:15
5956
|
@@ -78,7 +75,6 @@ LL | assert_send(non_sync_with_method_call_panic());
7875
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call_panic` is not `Send`
7976
|
8077
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
81-
= note: consider using `std::sync::Arc<dyn std::fmt::Write>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
8278
note: future is not `Send` as this value is used across an await
8379
--> $DIR/async-fn-nonsend.rs:56:15
8480
|
@@ -103,7 +99,6 @@ LL | assert_send(non_sync_with_method_call_infinite_loop());
10399
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call_infinite_loop` is not `Send`
104100
|
105101
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
106-
= note: consider using `std::sync::Arc<dyn std::fmt::Write>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
107102
note: future is not `Send` as this value is used across an await
108103
--> $DIR/async-fn-nonsend.rs:63:15
109104
|

tests/ui/async-await/drop-track-field-assign-nonsend.drop_tracking.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(agent.handle());
55
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/drop-track-field-assign-nonsend.rs:23:39
1110
|

tests/ui/async-await/drop-track-field-assign-nonsend.drop_tracking_mir.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(agent.handle());
55
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/drop-track-field-assign-nonsend.rs:23:39
1110
|

tests/ui/async-await/drop-track-field-assign-nonsend.no_drop_tracking.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(agent.handle());
55
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/drop-track-field-assign-nonsend.rs:23:39
1110
|

tests/ui/async-await/field-assign-nonsend.drop_tracking.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(agent.handle());
55
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/field-assign-nonsend.rs:23:39
1110
|

tests/ui/async-await/field-assign-nonsend.drop_tracking_mir.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(agent.handle());
55
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/field-assign-nonsend.rs:23:39
1110
|

tests/ui/async-await/field-assign-nonsend.no_drop_tracking.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_send(agent.handle());
55
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
8-
= note: use `std::sync::Arc` instead of `std::rc::Rc`
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/field-assign-nonsend.rs:23:39
1110
|

tests/ui/async-await/in-trait/missing-send-bound.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | assert_is_send(test::<T>());
55
| ^^^^^^^^^^^ future returned by `test` is not `Send`
66
|
77
= 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>
98
note: future is not `Send` as it awaits another future which is not `Send`
109
--> $DIR/missing-send-bound.rs:10:5
1110
|

tests/ui/async-await/issue-64130-1-sync.drop_tracking.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | is_sync(bar());
55
| ^^^^^ future returned by `bar` is not `Sync`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Sync` is not implemented for `Foo`
8-
= note: consider using `std::sync::Arc<Foo>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
98
note: future is not `Sync` as this value is used across an await
109
--> $DIR/issue-64130-1-sync.rs:18:11
1110
|

tests/ui/async-await/issue-64130-1-sync.drop_tracking_mir.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | is_sync(bar());
55
| ^^^^^ future returned by `bar` is not `Sync`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Sync` is not implemented for `Foo`
8-
= note: consider using `std::sync::Arc<Foo>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
98
note: future is not `Sync` as this value is used across an await
109
--> $DIR/issue-64130-1-sync.rs:18:11
1110
|

tests/ui/async-await/issue-64130-1-sync.no_drop_tracking.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | is_sync(bar());
55
| ^^^^^ future returned by `bar` is not `Sync`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Sync` is not implemented for `Foo`
8-
= note: consider using `std::sync::Arc<Foo>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
98
note: future is not `Sync` as this value is used across an await
109
--> $DIR/issue-64130-1-sync.rs:18:11
1110
|

tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | pub fn foo() -> impl Future + Send {
55
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
66
|
77
= 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>
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/issue-64130-4-async-move.rs:27:23
1110
|

tests/ui/async-await/issue-64130-non-send-future-diags.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | is_send(foo());
55
| ^^^^^ future returned by `foo` is not `Send`
66
|
77
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, u32>`
8-
= note: consider using `std::sync::Arc<MutexGuard<'_, u32>>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/issue-64130-non-send-future-diags.rs:17:11
1110
|

tests/ui/async-await/issue-67252-unnamed-future.drop_tracking.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ LL | | });
1010
| |_____^ future created by async block is not `Send`
1111
|
1212
= help: within `[async block@$DIR/issue-67252-unnamed-future.rs:21:11: 25:6]`, the trait `Send` is not implemented for `*mut ()`
13-
= note: consider using `std::sync::Arc<*mut ()>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
1413
note: future is not `Send` as this value is used across an await
1514
--> $DIR/issue-67252-unnamed-future.rs:23:17
1615
|

tests/ui/async-await/issue-67252-unnamed-future.drop_tracking_mir.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | spawn(async {
55
| ^^^^^ future created by async block is not `Send`
66
|
77
= help: within `[async block@$DIR/issue-67252-unnamed-future.rs:21:11: 25:6]`, the trait `Send` is not implemented for `*mut ()`
8-
= note: consider using `std::sync::Arc<*mut ()>`; for more information visit <https://doc.rust-lang.org/book/ch16-03-shared-state.html>
98
note: future is not `Send` as this value is used across an await
109
--> $DIR/issue-67252-unnamed-future.rs:23:17
1110
|

0 commit comments

Comments
 (0)