diff options
| author | bors <bors@rust-lang.org> | 2020-03-26 12:33:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-03-26 12:33:18 +0000 |
| commit | 2fbb07525e2f07a815e780a4268b11916248b5a9 (patch) | |
| tree | 45d6837d752b3628506e97f0ac317a258fa3619a /src/libcore | |
| parent | 3b1d7351186a073c72e4be3c7d7b7ab8f1f10c58 (diff) | |
| parent | 608715bbd10ec9a088d46f03db9afa689bfb3c90 (diff) | |
| download | rust-2fbb07525e2f07a815e780a4268b11916248b5a9.tar.gz rust-2fbb07525e2f07a815e780a4268b11916248b5a9.zip | |
Auto merge of #70427 - Centril:rollup-lrcad2c, r=Centril
Rollup of 5 pull requests Successful merges: - #68004 (permit negative impls for non-auto traits) - #70385 (Miri nits: comment and var name improvement) - #70411 (Fix for #62691: use the largest niche across all fields) - #70417 (parser: recover on `...` as a pattern, suggesting `..`) - #70424 (simplify match stmt) Failed merges: r? @ghost
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/clone.rs | 7 | ||||
| -rw-r--r-- | src/libcore/lib.rs | 1 | ||||
| -rw-r--r-- | src/libcore/marker.rs | 4 | ||||
| -rw-r--r-- | src/libcore/ops/deref.rs | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index 9a412e57294..eb101fc72fd 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -219,7 +219,7 @@ mod impls { } } - // Shared references can be cloned, but mutable references *cannot*! + /// Shared references can be cloned, but mutable references *cannot*! #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> Clone for &T { #[inline] @@ -227,4 +227,9 @@ mod impls { *self } } + + /// Shared references can be cloned, but mutable references *cannot*! + #[stable(feature = "rust1", since = "1.0.0")] + #[cfg(not(bootstrap))] + impl<T: ?Sized> !Clone for &mut T {} } diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 94fc2fd357a..0bee16f98bd 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -98,6 +98,7 @@ #![feature(is_sorted)] #![feature(lang_items)] #![feature(link_llvm_intrinsics)] +#![cfg_attr(not(bootstrap), feature(negative_impls))] #![feature(never_type)] #![feature(nll)] #![feature(exhaustive_patterns)] diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 2b908f07af8..549f80de36a 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -87,7 +87,7 @@ impl<T: ?Sized> !Send for *mut T {} message = "the size for values of type `{Self}` cannot be known at compilation time", label = "doesn't have a size known at compile-time", note = "to learn more, visit <https://doc.rust-lang.org/book/\ - ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>" + ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>" )] #[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable #[cfg_attr(not(bootstrap), rustc_specialization_trait)] @@ -790,7 +790,7 @@ mod copy_impls { #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> Copy for *mut T {} - // Shared references can be copied, but mutable references *cannot*! + /// Shared references can be copied, but mutable references *cannot*! #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> Copy for &T {} } diff --git a/src/libcore/ops/deref.rs b/src/libcore/ops/deref.rs index 68244fdb381..e2deeb55661 100644 --- a/src/libcore/ops/deref.rs +++ b/src/libcore/ops/deref.rs @@ -81,6 +81,10 @@ impl<T: ?Sized> Deref for &T { } } +#[cfg(not(bootstrap))] +#[stable(feature = "rust1", since = "1.0.0")] +impl<T: ?Sized> !DerefMut for &T {} + #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> Deref for &mut T { type Target = T; |
