diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 1b6e84175b934..1a055a0a5adc8 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -3072,7 +3072,7 @@ impl str { /// for example references to `Box` or `Arc`. #[inline] #[unstable(feature = "str_as_str", issue = "130366")] - pub fn as_str(&self) -> &str { + pub const fn as_str(&self) -> &str { self } }