Skip to content

Commit 1646152

Browse files
authored
Unrolled build for #145664
Rollup merge of #145664 - Darksonn:stab-file-with-nul, r=Mark-Simulacrum Stabilize `std::panic::Location::file_as_c_str` Closes: #141727 Nominating this for T-lang as per ```@traviscross``` #141727 (comment)
2 parents dd7fda5 + 46727f4 commit 1646152

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/core/src/panic/location.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ impl<'a> Location<'a> {
193193
/// This is useful for interop with APIs that expect C/C++ `__FILE__` or
194194
/// `std::source_location::file_name`, both of which return a nul-terminated `const char*`.
195195
#[must_use]
196-
#[unstable(feature = "file_with_nul", issue = "141727")]
197196
#[inline]
197+
#[stable(feature = "file_with_nul", since = "CURRENT_RUSTC_VERSION")]
198+
#[rustc_const_stable(feature = "file_with_nul", since = "CURRENT_RUSTC_VERSION")]
198199
pub const fn file_as_c_str(&self) -> &'a CStr {
199200
let filename = self.filename.as_ptr();
200201

tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ run-pass
2-
#![feature(file_with_nul)]
32

43
#[track_caller]
54
const fn assert_file_has_trailing_zero() {

0 commit comments

Comments
 (0)