-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-panicArea: Panicking machineryArea: Panicking machineryA-rust-for-linuxRelevant for the Rust-for-Linux projectRelevant for the Rust-for-Linux projectC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.Status: The implementation is "complete" but it needs time to bake.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(file_with_nul)]
This is a tracking issue for Location::file_with_nul
.
This feature allows you to obtain NUL-terminated file names from core::panic::Location
when using #[track_caller]
. This allows for better error messages in projects performing interop with C/C++.
Public API
// core::panic
pub struct Location;
impl Location {
pub const fn file_with_nul(&self) -> &CStr;
}
Steps / History
(Remember to update the S-tracking-*
label when checking boxes.)
- Accept ACP: ACP: Add nul-terminated version of
core::panic::Location::file
libs-team#466 - Implementation:
- Resolve open questions:
- Final comment period (FCP)1
- Stabilization PR
Related PRs:
- Add nul-terminated filename for #[track_caller] #131828
- Add unstable option to nul-terminate location strings #135240
- Null terminate
core::panic::Location
file strings #117431 - Use raw pointer for NUL-terminated file location with
#[track_caller]
#142579 - Do not include NUL-terminator in computed length #142708
Footnotes
Metadata
Metadata
Assignees
Labels
A-panicArea: Panicking machineryArea: Panicking machineryA-rust-for-linuxRelevant for the Rust-for-Linux projectRelevant for the Rust-for-Linux projectC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.Status: The implementation is "complete" but it needs time to bake.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.