diff options
| author | Nathaniel McCallum <nathaniel@mccallum.life> | 2025-08-31 22:26:10 -0400 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2025-09-06 04:35:52 +0200 |
| commit | 00fcb14e4e6e4fb28fde6a286fd9ac30a2d457c7 (patch) | |
| tree | 00d1276f71461788745df2b5cc15af546d3d3e76 /library/core/src/convert | |
| parent | 6c699a37235700ab749e3f14147fe41d49c056e8 (diff) | |
clean up some old const trait impl syntax
Diffstat (limited to 'library/core/src/convert')
| -rw-r--r-- | library/core/src/convert/mod.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index add21b491ad..a3cfd85974a 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -216,9 +216,8 @@ pub const fn identity<T>(x: T) -> T { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "AsRef"] -#[const_trait] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] -pub trait AsRef<T: PointeeSized>: PointeeSized { +pub const trait AsRef<T: PointeeSized>: PointeeSized { /// Converts this type into a shared reference of the (usually inferred) input type. #[stable(feature = "rust1", since = "1.0.0")] fn as_ref(&self) -> &T; @@ -369,9 +368,8 @@ pub trait AsRef<T: PointeeSized>: PointeeSized { /// `&mut Vec<u8>`, for example, is the better choice (callers need to pass the correct type then). #[stable(feature = "rust1", since = "1.0.0")] #[rustc_diagnostic_item = "AsMut"] -#[const_trait] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] -pub trait AsMut<T: PointeeSized>: PointeeSized { +pub const trait AsMut<T: PointeeSized>: PointeeSized { /// Converts this type into a mutable reference of the (usually inferred) input type. #[stable(feature = "rust1", since = "1.0.0")] fn as_mut(&mut self) -> &mut T; @@ -450,8 +448,7 @@ pub trait AsMut<T: PointeeSized>: PointeeSized { #[stable(feature = "rust1", since = "1.0.0")] #[doc(search_unbox)] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] -#[const_trait] -pub trait Into<T>: Sized { +pub const trait Into<T>: Sized { /// Converts this type into the (usually inferred) input type. #[must_use] #[stable(feature = "rust1", since = "1.0.0")] @@ -587,8 +584,7 @@ pub trait Into<T>: Sized { ))] #[doc(search_unbox)] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] -#[const_trait] -pub trait From<T>: Sized { +pub const trait From<T>: Sized { /// Converts to this type from the input type. #[rustc_diagnostic_item = "from_fn"] #[must_use] @@ -616,8 +612,7 @@ pub trait From<T>: Sized { #[rustc_diagnostic_item = "TryInto"] #[stable(feature = "try_from", since = "1.34.0")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] -#[const_trait] -pub trait TryInto<T>: Sized { +pub const trait TryInto<T>: Sized { /// The type returned in the event of a conversion error. #[stable(feature = "try_from", since = "1.34.0")] type Error; @@ -696,8 +691,7 @@ pub trait TryInto<T>: Sized { #[rustc_diagnostic_item = "TryFrom"] #[stable(feature = "try_from", since = "1.34.0")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] -#[const_trait] -pub trait TryFrom<T>: Sized { +pub const trait TryFrom<T>: Sized { /// The type returned in the event of a conversion error. #[stable(feature = "try_from", since = "1.34.0")] type Error; |
