Skip to content

Commit 0bb3b8d

Browse files
authored
Rollup merge of rust-lang#145928 - Darksonn:file_as_c_str, r=joshtriplett
Rename `Location::file_with_nul` to `file_as_c_str` This renames the method to be consistent with the ongoing T-libs-api FCP found at rust-lang#141727 (comment). I did not rename the unstable feature as we are going to be stabilizing it soon anyway. This will probably break RfL, so it will require an updated commit hash for the Linux Kernel that I will add here soon. r? `@Amanieu`
2 parents d9f4f1e + 08e18b3 commit 0bb3b8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/panic/location.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use crate::ptr::NonNull;
3939
pub struct Location<'a> {
4040
// A raw pointer is used rather than a reference because the pointer is valid for one more byte
4141
// than the length stored in this pointer; the additional byte is the NUL-terminator used by
42-
// `Location::file_with_nul`.
42+
// `Location::file_as_c_str`.
4343
filename: NonNull<str>,
4444
line: u32,
4545
col: u32,
@@ -195,7 +195,7 @@ impl<'a> Location<'a> {
195195
#[must_use]
196196
#[unstable(feature = "file_with_nul", issue = "141727")]
197197
#[inline]
198-
pub const fn file_with_nul(&self) -> &'a CStr {
198+
pub const fn file_as_c_str(&self) -> &'a CStr {
199199
let filename = self.filename.as_ptr();
200200

201201
// SAFETY: The filename is valid for `filename_len+1` bytes, so this addition can't

0 commit comments

Comments
 (0)