about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPavel Grigorenko <GrigorenkoPV@ya.ru>2025-08-27 16:15:08 +0300
committerPavel Grigorenko <GrigorenkoPV@ya.ru>2025-08-27 16:26:24 +0300
commite06cd9f2c82c5bb3999eafda7abe2b1951384f78 (patch)
tree0385b04e9f996be5e205dae21a0a234b1b62f22c
parent4f808ba6bf9f1c8dde30d009e73386d984491587 (diff)
downloadrust-e06cd9f2c82c5bb3999eafda7abe2b1951384f78.tar.gz
rust-e06cd9f2c82c5bb3999eafda7abe2b1951384f78.zip
`const`ify (the unstable) `str::as_str`
-rw-r--r--library/core/src/str/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index 1b6e84175b9..1a055a0a5ad 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<str>` or `Arc<str>`.
     #[inline]
     #[unstable(feature = "str_as_str", issue = "130366")]
-    pub fn as_str(&self) -> &str {
+    pub const fn as_str(&self) -> &str {
         self
     }
 }