Use raw pointer for NUL-terminated file location with `#[track_caller]` by Darksonn · Pull Request #142579 · rust-lang/rust

@Darksonn added T-libs-api

Relevant to the library API team, which will review and decide on the PR/issue.

I-libs-api-nominated

Nominated for discussion during a libs-api team meeting.

A-panic

Area: Panicking machinery

A-rust-for-linux

Relevant for the Rust-for-Linux project

labels

Jun 16, 2025

@Darksonn

@Darksonn

@ojeda ojeda mentioned this pull request

Jun 16, 2025

48 tasks

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jun 28, 2025
… r=Mark-Simulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of rust-lang#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jun 28, 2025
… r=Mark-Simulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of rust-lang#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jun 28, 2025
… r=Mark-Simulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of rust-lang#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jun 28, 2025
… r=Mark-Simulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of rust-lang#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Jun 28, 2025
… r=Mark-Simulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of rust-lang#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.

rust-timer added a commit that referenced this pull request

Jun 29, 2025
Rollup merge of #142708 - Darksonn:location-len-without-nul, r=Mark-Simulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of #142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Jun 29, 2025
…imulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of rust-lang/rust#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Jul 4, 2025
… r=Mark-Simulacrum

Do not include NUL-terminator in computed length

This PR contains just the first commit of rust-lang#142579 which changes it so that the string length stored in the `Location` is the length of the `&str` rather than the length of the `&CStr`. Since most users will want the `&str` length, it seems better to optimize for that use-case.

There should be no visible changes in the behavior or API.

@ojeda ojeda mentioned this pull request

Feb 8, 2026

57 tasks