Skip to content

Conversation

Darksonn
Copy link
Contributor

@Darksonn Darksonn commented Jan 8, 2025

This is an alternative to #135054 for the ACP rust-lang/libs-team#466 that provides a compiler flag for adding a nul-terminator to filename strings.

Personally I still prefer adding a dedicated method to avoid provenance crimes, but this approach allows users to avoid increasing the binary size.

One potential way to avoid provenance questions is to add a Location::file_ptr method that returns a *const u8 pointer to the filename. This raw pointer can have provenance to access the nul-terminator even if the &str doesn't.

The new option is added to -Zlocation-detail instead of adding a new flag. This seems to be the simplest way to provide the option. Since -Zlocation-detail is unstable, this does not commit to supporting the feature.

@rustbot
Copy link
Collaborator

rustbot commented Jan 8, 2025

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 8, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 8, 2025

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

@oli-obk oli-obk assigned oli-obk and unassigned fmease Jan 8, 2025
@oli-obk oli-obk added I-needs-decision Issue: In need of a decision. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 8, 2025
@Dylan-DPC Dylan-DPC added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 18, 2025
@Darksonn Darksonn closed this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-needs-decision Issue: In need of a decision. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants