File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ impl<T: ?Sized> !Send for *const T {}
4444#[ stable( feature = "rust1" , since = "1.0.0" ) ]
4545impl < T : ?Sized > !Send for * mut T { }
4646
47+ // Most instances arise automatically, but this instance is needed to link up `T: Sync` with
48+ // `&T: Send` (and it also removes the unsound default instance `T Send` -> `&T: Send` that would
49+ // otherwise exist).
50+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
51+ unsafe impl < T : Sync + ?Sized > Send for & T { }
52+
4753/// Types with a constant size known at compile time.
4854///
4955/// All type parameters have an implicit bound of `Sized`. The special syntax
@@ -680,13 +686,6 @@ pub struct PhantomData<T: ?Sized>;
680686
681687impls ! { PhantomData }
682688
683- mod impls {
684- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
685- unsafe impl < T : Sync + ?Sized > Send for & T { }
686- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
687- unsafe impl < T : Send + ?Sized > Send for & mut T { }
688- }
689-
690689/// Compiler-internal trait used to indicate the type of enum discriminants.
691690///
692691/// This trait is automatically implemented for every type and does not add any
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ error: future cannot be sent between threads safely
2727LL | assert_send(non_sync_with_method_call());
2828 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
2929 |
30- = help: the trait `Send` is not implemented for `dyn std::fmt::Write`
30+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
3131note: future is not `Send` as this value is used across an await
3232 --> $DIR/async-fn-nonsend.rs:46:14
3333 |
You can’t perform that action at this time.
0 commit comments