File tree 2 files changed +7
-8
lines changed
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 {}
44
44
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
45
45
impl < T : ?Sized > !Send for * mut T { }
46
46
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
+
47
53
/// Types with a constant size known at compile time.
48
54
///
49
55
/// All type parameters have an implicit bound of `Sized`. The special syntax
@@ -680,13 +686,6 @@ pub struct PhantomData<T: ?Sized>;
680
686
681
687
impls ! { PhantomData }
682
688
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
-
690
689
/// Compiler-internal trait used to indicate the type of enum discriminants.
691
690
///
692
691
/// 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
27
27
LL | assert_send(non_sync_with_method_call());
28
28
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
29
29
|
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`
31
31
note: future is not `Send` as this value is used across an await
32
32
--> $DIR/async-fn-nonsend.rs:46:14
33
33
|
You can’t perform that action at this time.
0 commit comments