Uh oh!
There was an error while loading. Please reload this page.
fix panic when rustc tries to reduce intermediate filenames len with utf8 - #148018
Conversation
rustbot
commented
Oct 23, 2025
tardyp
commented
Oct 23, 2025
not sure of the process for urgent beta fixes. I uploaded two versions of this patch, this one against master and #148019 against beta |
apiraino
commented
Oct 23, 2025
Thanks @tardyp! Patches for regressions can either be fixed on the master branch (like this one) or directly on the beta branch. In practice I think there is no big difference; fixing stuff on master obviously needs a backport patch to beta (which you have already submitted). In both case they are nominated for backport approval (see docs) and discussed during the weekly T-compiler triage meeting (in ~4 hours from now 🙂 ) |
jieyouxu
commented
Oct 23, 2025
r? compiler (wont get to this soon) |
Noratrieb
commented
Oct 23, 2025
I've nominates this one for backport and will close the other PR to follow our standard process of nominating PRs against master and then letting the release team cherry pick approved backports. Thank you for the quick fix! |
| .char_indices() | ||
| .find(|(i, _)| *i >= stripped_bytes) | ||
| .map(|(i, _)| i) | ||
| .unwrap_or(filename.len()); |
There was a problem hiding this comment.
I believe that the 5 lines above are equivalent to:
let split_at = filename.ceil_char_boundary(stripped_bytes);r=me after the comment above is resolved |
rustbot
commented
Oct 23, 2025
Reminder, once the PR becomes ready for a review, use |
96868ac to
a968930Comparetardyp
commented
Oct 23, 2025
@rustbot ready |
tardyp
commented
Oct 23, 2025
@thanks@JonathanBrouwer for the thoughtful suggestion on this recently out of nightly api. Note that I took the opportunity of this rework to replace the boring "28_找出字符串中第一个匹配项的下标" by more entertaining "ⴻⵎⵎⴻⵎ_ⴷⵉⵎⴰ_ⵖⴻⴼ_ⵢⵉⵙⴻⴽⴽⵉⵍⴻⵏ_ⵏ_ⵡⴰⵟⴰⵙ_ⵏ_ⵢⵉⴱⵢⵜⴻⵏ" which more adequately watches for multi byte character issues. |
JonathanBrouwer
commented
Oct 23, 2025
Thank you so much for the quick fix! |
bors
commented
Oct 23, 2025
Uh oh!
There was an error while loading. Please reload this page.
…th multi byte chars The issue cannot be reproduced with the former testcase of creating external crates because rust refuses to use "external crate 28_找出字符串中第一个匹配项的下标" because it is not a valid indentifier (starts with number, and contain non ascii chars) But still using 28_找出字符串中第一个匹配项的下标.rs as a filename is accepted by previous rustc releases So we consider it valid, and add an integration test for it to catch any regression on other code related to non ascii filenames.
d73e0b8 to
c6acffeCompareJonathanBrouwer
commented
Oct 24, 2025
This comment has been minimized.
This comment has been minimized.
fix panic when rustc tries to reduce intermediate filenames len with utf8 try-job: x86_64-mingw-* try-job: i686-msvc-*
tardyp
commented
Oct 24, 2025
I'll be in vacation tomorrow for a week, mostly afk, so I wouldn't be able to be so reactive. hopefully we can finish this today! |
cuviper
commented
Oct 24, 2025
Let's boost this so we can get to the beta backport too... @bors r=JonathanBrouwer p=5 |
bors
commented
Oct 24, 2025
bors
commented
Oct 24, 2025
bors
commented
Oct 24, 2025
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing ab92564 (parent) -> 2aaa62b (this PR) Test differencesShow 6 test diffsStage 1
Stage 2
Additionally, 2 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 2aaa62b89d22b570e560731b03e3d2d6f5c3bbce --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
| let stripped_bytes = filename.len().saturating_sub(allowed_suffix); | ||
| // ensure we don't cut in a middle of a char | ||
| let split_at = filename.ceil_char_boundary(stripped_bytes); |
There was a problem hiding this comment.
FYI, I needed to bootstrap the round_char_boundary feature for this:
1e668e0#diff-a984c7e4fd6f10b956c673e00529f4f80cecdd5572d349ce1fda61b7ce63c5aa
(not a problem, just noting the difference in backport)
rust-timer
commented
Oct 24, 2025
Finished benchmarking commit (2aaa62b): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary -2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 474.337s -> 475.049s (0.15%) |
[beta] backports - Revert constification of `AsRef for Cow` due to inference failure #148011 - Revert constification of `Borrow` and `Deref for Cow` due to inference failure #148016 - Revert "fix: Filter suggestion parts that match existing code" #148043 - Revert "feat: implement `hash_map!` macro" #148049 - fix panic when rustc tries to reduce intermediate filenames len with utf8 #148018 r? cuviper
[beta] backports - Revert constification of `AsRef for Cow` due to inference failure #148011 - Revert constification of `Borrow` and `Deref for Cow` due to inference failure #148016 - Revert "fix: Filter suggestion parts that match existing code" #148043 - Revert "feat: implement `hash_map!` macro" #148049 - fix panic when rustc tries to reduce intermediate filenames len with utf8 #148018 r? cuviper
…thanBrouwer fix panic when rustc tries to reduce intermediate filenames len with utf8 The issue cannot be reproduced with the former testcase of creating external crates because rust refuses to use "external crate 28_找出字符串中第一个匹配项的下标" because it is not a valid indentifier (starts with number, and contain non ascii chars) But still using 28_找出字符串中第一个匹配项的下标.rs as a filename is accepted by previous rustc releases So we consider it valid, and add an integration test for it to catch any regression on other code related to non ascii filenames. Fixrust-lang#147975
…thanBrouwer fix panic when rustc tries to reduce intermediate filenames len with utf8 The issue cannot be reproduced with the former testcase of creating external crates because rust refuses to use "external crate 28_找出字符串中第一个匹配项的下标" because it is not a valid indentifier (starts with number, and contain non ascii chars) But still using 28_找出字符串中第一个匹配项的下标.rs as a filename is accepted by previous rustc releases So we consider it valid, and add an integration test for it to catch any regression on other code related to non ascii filenames. Fixrust-lang#147975
The issue cannot be reproduced with the former testcase of creating external crates because rust refuses to use "external crate 28_找出字符串中第一个匹配项的下标" because it is not a valid indentifier (starts with number, and contain non ascii chars)
But still using 28_找出字符串中第一个匹配项的下标.rs as a filename is accepted by previous rustc releases So we consider it valid, and add an integration test for it to catch any regression on other code related to non ascii filenames.
Fix#147975