summaryrefslogtreecommitdiffstats
path: root/library/core/src/clone.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /library/core/src/clone.rs
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/core/src/clone.rs')
-rw-r--r--library/core/src/clone.rs23
1 files changed, 6 insertions, 17 deletions
diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs
index 398437d9a..a6d6230d3 100644
--- a/library/core/src/clone.rs
+++ b/library/core/src/clone.rs
@@ -36,8 +36,6 @@
#![stable(feature = "rust1", since = "1.0.0")]
-use crate::marker::Destruct;
-
/// A common trait for the ability to explicitly duplicate an object.
///
/// Differs from [`Copy`] in that [`Copy`] is implicit and an inexpensive bit-wise copy, while
@@ -106,7 +104,6 @@ use crate::marker::Destruct;
#[lang = "clone"]
#[rustc_diagnostic_item = "Clone"]
#[rustc_trivial_field_reads]
-#[const_trait]
pub trait Clone: Sized {
/// Returns a copy of the value.
///
@@ -129,10 +126,7 @@ pub trait Clone: Sized {
/// allocations.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
- fn clone_from(&mut self, source: &Self)
- where
- Self: ~const Destruct,
- {
+ fn clone_from(&mut self, source: &Self) {
*self = source.clone()
}
}
@@ -182,8 +176,7 @@ mod impls {
($($t:ty)*) => {
$(
#[stable(feature = "rust1", since = "1.0.0")]
- #[rustc_const_unstable(feature = "const_clone", issue = "91805")]
- impl const Clone for $t {
+ impl Clone for $t {
#[inline(always)]
fn clone(&self) -> Self {
*self
@@ -201,8 +194,7 @@ mod impls {
}
#[unstable(feature = "never_type", issue = "35121")]
- #[rustc_const_unstable(feature = "const_clone", issue = "91805")]
- impl const Clone for ! {
+ impl Clone for ! {
#[inline]
fn clone(&self) -> Self {
*self
@@ -210,8 +202,7 @@ mod impls {
}
#[stable(feature = "rust1", since = "1.0.0")]
- #[rustc_const_unstable(feature = "const_clone", issue = "91805")]
- impl<T: ?Sized> const Clone for *const T {
+ impl<T: ?Sized> Clone for *const T {
#[inline(always)]
fn clone(&self) -> Self {
*self
@@ -219,8 +210,7 @@ mod impls {
}
#[stable(feature = "rust1", since = "1.0.0")]
- #[rustc_const_unstable(feature = "const_clone", issue = "91805")]
- impl<T: ?Sized> const Clone for *mut T {
+ impl<T: ?Sized> Clone for *mut T {
#[inline(always)]
fn clone(&self) -> Self {
*self
@@ -229,8 +219,7 @@ mod impls {
/// Shared references can be cloned, but mutable references *cannot*!
#[stable(feature = "rust1", since = "1.0.0")]
- #[rustc_const_unstable(feature = "const_clone", issue = "91805")]
- impl<T: ?Sized> const Clone for &T {
+ impl<T: ?Sized> Clone for &T {
#[inline(always)]
#[rustc_diagnostic_item = "noop_method_clone"]
fn clone(&self) -> Self {