about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-21 14:42:34 +1000
committerGitHub <noreply@github.com>2025-09-21 14:42:34 +1000
commitb0c55c8554c9a120e97e15941d552aa9b14af427 (patch)
tree05efec0116ab19bc8550a4153d658a4d7bc111e0 /library
parent7a5819d1544918f8b11105535df58de731a217f9 (diff)
parent46727f4cb06c3496a541ee8517a24ef5cb77627c (diff)
downloadrust-b0c55c8554c9a120e97e15941d552aa9b14af427.tar.gz
rust-b0c55c8554c9a120e97e15941d552aa9b14af427.zip
Rollup merge of #145664 - Darksonn:stab-file-with-nul, r=Mark-Simulacrum
Stabilize `std::panic::Location::file_as_c_str`

Closes: rust-lang/rust#141727

Nominating this for T-lang as per ```@traviscross```  https://github.com/rust-lang/rust/issues/141727#issuecomment-3201318429
Diffstat (limited to 'library')
-rw-r--r--library/core/src/panic/location.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/panic/location.rs b/library/core/src/panic/location.rs
index 7a68d393906..59358493444 100644
--- a/library/core/src/panic/location.rs
+++ b/library/core/src/panic/location.rs
@@ -193,8 +193,9 @@ impl<'a> Location<'a> {
     /// This is useful for interop with APIs that expect C/C++ `__FILE__` or
     /// `std::source_location::file_name`, both of which return a nul-terminated `const char*`.
     #[must_use]
-    #[unstable(feature = "file_with_nul", issue = "141727")]
     #[inline]
+    #[stable(feature = "file_with_nul", since = "CURRENT_RUSTC_VERSION")]
+    #[rustc_const_stable(feature = "file_with_nul", since = "CURRENT_RUSTC_VERSION")]
     pub const fn file_as_c_str(&self) -> &'a CStr {
         let filename = self.filename.as_ptr();