diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index b1513e5e0f31c..b3f0bc6baac49 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2701,7 +2701,8 @@ impl<'a> From> for String { #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> From<&'a str> for Cow<'a, str> { +#[rustc_const_unstable(feature = "const_convert", issue = "88674")] +impl<'a> const From<&'a str> for Cow<'a, str> { /// Converts a string slice into a [`Borrowed`] variant. /// No heap allocation is performed, and the string /// is not copied. @@ -2722,7 +2723,8 @@ impl<'a> From<&'a str> for Cow<'a, str> { #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> From for Cow<'a, str> { +#[rustc_const_unstable(feature = "const_convert", issue = "88674")] +impl<'a> const From for Cow<'a, str> { /// Converts a [`String`] into an [`Owned`] variant. /// No heap allocation is performed, and the string /// is not copied.