diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 3a149afd77182..5566c2ffe87de 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -481,9 +481,10 @@ pub trait TryFrom: Sized { // As lifts over & #[stable(feature = "rust1", since = "1.0.0")] -impl AsRef for &T +#[rustc_const_unstable(feature = "const_convert", issue = "88674")] +impl const AsRef for &T where - T: AsRef, + T: ~const AsRef, { fn as_ref(&self) -> &U { >::as_ref(*self) @@ -492,9 +493,10 @@ where // As lifts over &mut #[stable(feature = "rust1", since = "1.0.0")] -impl AsRef for &mut T +#[rustc_const_unstable(feature = "const_convert", issue = "88674")] +impl const AsRef for &mut T where - T: AsRef, + T: ~const AsRef, { fn as_ref(&self) -> &U { >::as_ref(*self) @@ -511,9 +513,10 @@ where // AsMut lifts over &mut #[stable(feature = "rust1", since = "1.0.0")] -impl AsMut for &mut T +#[rustc_const_unstable(feature = "const_convert", issue = "88674")] +impl const AsMut for &mut T where - T: AsMut, + T: ~const AsMut, { fn as_mut(&mut self) -> &mut U { (*self).as_mut() @@ -567,9 +570,10 @@ impl const From for T { // TryFrom implies TryInto #[stable(feature = "try_from", since = "1.34.0")] -impl TryInto for T +#[rustc_const_unstable(feature = "const_convert", issue = "88674")] +impl const TryInto for T where - U: TryFrom, + U: ~const TryFrom, { type Error = U::Error; @@ -581,9 +585,10 @@ where // Infallible conversions are semantically equivalent to fallible conversions // with an uninhabited error type. #[stable(feature = "try_from", since = "1.34.0")] -impl TryFrom for T +#[rustc_const_unstable(feature = "const_convert", issue = "88674")] +impl const TryFrom for T where - U: Into, + U: ~const Into, { type Error = Infallible;