Skip to content

Conversation

reitermarkus
Copy link
Contributor

@reitermarkus reitermarkus commented Mar 5, 2025

Allow optimizing out panic_bounds_check in Unicode checks.

For context, see japaric/ufmt#52 (comment).

@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2025

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 5, 2025
@reitermarkus reitermarkus force-pushed the unicode-panic-optimization branch 3 times, most recently from 2e2233e to 59a9073 Compare March 5, 2025 19:15
@reitermarkus reitermarkus marked this pull request as ready for review March 6, 2025 08:20
@reitermarkus

This comment was marked as outdated.

@reitermarkus reitermarkus force-pushed the unicode-panic-optimization branch from fce8bd5 to 218dfd8 Compare March 6, 2025 20:49
@reitermarkus reitermarkus force-pushed the unicode-panic-optimization branch 2 times, most recently from 4192cb2 to 90ebc24 Compare March 8, 2025 02:12
@rustbot
Copy link
Collaborator

rustbot commented Mar 8, 2025

library/core/src/unicode/unicode_data.rs is generated by
src/tools/unicode-table-generator via ./x run src/tools/unicode-table-generator. If you want to modify unicode_data.rs,
please modify the tool then regenerate the library source file with the tool
instead of editing the library source file manually.

@rust-log-analyzer

This comment has been minimized.

@ibraheemdev
Copy link
Member

I reverted the actual changes for now to check if the test is working first. Not sure how to get revisions to work. Locally, I was only able to test the changes in a no_std embedded project so far. For x86 it doesn't seem to make a difference in terms of optimization since without revisions, the test passes regardless of the changes.

Sorry I don't follow, what change was reverted?

@reitermarkus
Copy link
Contributor Author

Sorry I don't follow, what change was reverted?

Nevermind, this now contains all necessary changes.

However, the test I added passes regardless of the other changes, I guess the bounds check is optimized out on x86_64 in any case. When using e.g. thumbv7m-none-eabi, it does make a difference though.

@reitermarkus
Copy link
Contributor Author

@ibraheemdev, can you take a look at this? Thanks!

@ibraheemdev
Copy link
Member

This looks good. It's interesting that it only makes a difference on thumbv7m-none-eabi, but seems fine regardless. @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 4, 2025

📌 Commit 3628a8f has been approved by ibraheemdev

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 4, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 5, 2025
Rollup of 11 pull requests

Successful merges:

 - rust-lang#136457 (Expose algebraic floating point intrinsics)
 - rust-lang#137880 (Autodiff batching)
 - rust-lang#137897 (fix pthread-based tls on apple targets)
 - rust-lang#138024 (Allow optimizing out `panic_bounds_check` in Unicode checks.)
 - rust-lang#138546 (Add integer to string formatting tests)
 - rust-lang#138826 (StableMIR: Add `associated_items`.)
 - rust-lang#138950 (replace extra_filename with strict version hash in metrics file names)
 - rust-lang#139274 (Rustdoc: typecheck settings.js)
 - rust-lang#139285 (use lower case to match other error messages)
 - rust-lang#139341 (Apply `Recovery::Forbidden` when reparsing pasted macro fragments.)
 - rust-lang#139389 (make `Arguments::as_statically_known_str` doc(hidden))

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a038028 into rust-lang:master Apr 5, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 5, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 5, 2025
Rollup merge of rust-lang#138024 - reitermarkus:unicode-panic-optimization, r=ibraheemdev

Allow optimizing out `panic_bounds_check` in Unicode checks.

Allow optimizing out `panic_bounds_check` in Unicode checks.

For context, see japaric/ufmt#52 (comment).
@reitermarkus reitermarkus deleted the unicode-panic-optimization branch April 6, 2025 22:00
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 10, 2025
…ation, r=ibraheemdev

Allow optimizing out `panic_bounds_check` in Unicode checks.

Allow optimizing out `panic_bounds_check` in Unicode checks.

For context, see japaric/ufmt#52 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library 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