about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorAlice Ryhl <aliceryhl@google.com>2025-08-27 12:42:49 +0000
committerAlice Ryhl <aliceryhl@google.com>2025-08-27 12:42:49 +0000
commitdacae07b6d8c42f5eca57de9c18e17349994d654 (patch)
treeaf548c17a21713b54d39e1620b215c27f30ac976 /library/core/src
parentb2dd217dd0a099fb87601657ec480bf3e92b30a6 (diff)
downloadrust-dacae07b6d8c42f5eca57de9c18e17349994d654.tar.gz
rust-dacae07b6d8c42f5eca57de9c18e17349994d654.zip
Rename `Location::file_with_nul` to `file_as_c_str`
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/panic/location.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/panic/location.rs b/library/core/src/panic/location.rs
index cafdcfa2c2e..7a68d393906 100644
--- a/library/core/src/panic/location.rs
+++ b/library/core/src/panic/location.rs
@@ -39,7 +39,7 @@ use crate::ptr::NonNull;
 pub struct Location<'a> {
     // A raw pointer is used rather than a reference because the pointer is valid for one more byte
     // than the length stored in this pointer; the additional byte is the NUL-terminator used by
-    // `Location::file_with_nul`.
+    // `Location::file_as_c_str`.
     filename: NonNull<str>,
     line: u32,
     col: u32,
@@ -195,7 +195,7 @@ impl<'a> Location<'a> {
     #[must_use]
     #[unstable(feature = "file_with_nul", issue = "141727")]
     #[inline]
-    pub const fn file_with_nul(&self) -> &'a CStr {
+    pub const fn file_as_c_str(&self) -> &'a CStr {
         let filename = self.filename.as_ptr();
 
         // SAFETY: The filename is valid for `filename_len+1` bytes, so this addition can't