diff options
| author | Alice Ryhl <aliceryhl@google.com> | 2025-08-20 15:04:34 +0000 |
|---|---|---|
| committer | Alice Ryhl <aliceryhl@google.com> | 2025-08-29 08:33:54 +0000 |
| commit | 46727f4cb06c3496a541ee8517a24ef5cb77627c (patch) | |
| tree | bc96f342a66f1d6366915e2b10e400768bdbf9d7 | |
| parent | 41f2b6b39e7526a28d50ff6918dda6de48add5e4 (diff) | |
| download | rust-46727f4cb06c3496a541ee8517a24ef5cb77627c.tar.gz rust-46727f4cb06c3496a541ee8517a24ef5cb77627c.zip | |
Stabilize file_as_c_str
| -rw-r--r-- | library/core/src/panic/location.rs | 3 | ||||
| -rw-r--r-- | tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs | 1 |
2 files changed, 2 insertions, 2 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(); diff --git a/tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs b/tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs index 7902f40b09b..698492966ad 100644 --- a/tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs +++ b/tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs @@ -1,5 +1,4 @@ //@ run-pass -#![feature(file_with_nul)] #[track_caller] const fn assert_file_has_trailing_zero() { |
