-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wrapped valid-range handling in ty_find_init_error #103402
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Oct 22, 2022
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Oct 22, 2022
r? @oli-obk |
I think we already have layout_scalar_valid_range ui tests, please add a test for this case to them |
joshtriplett
force-pushed
the
niche-wrap-fix
branch
from
October 22, 2022 22:16
83359c8
to
ee90059
Compare
Added a test, waiting for the test failure to give me the updated output. |
joshtriplett
force-pushed
the
niche-wrap-fix
branch
3 times, most recently
from
October 22, 2022 23:14
0dcce9e
to
b6b3af3
Compare
This comment has been minimized.
This comment has been minimized.
Rust's niche handling allows for wrapping valid ranges with end < start; for instance, a valid range with start=43 and end=41 means a niche of 42. Most places in the compiler handle this correctly, but ty_find_init_error assumed that `lo > 0` means the type cannot contain a zero. Fix it to handle wrapping ranges. Add a test to cover this case.
joshtriplett
force-pushed
the
niche-wrap-fix
branch
from
October 22, 2022 23:33
b6b3af3
to
36662df
Compare
@oli-obk OK, I think this is ready now. Good call adding a test. |
@bors r+ rollup |
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
Oct 23, 2022
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Oct 23, 2022
…-obk Fix wrapped valid-range handling in ty_find_init_error Rust's niche handling allows for wrapping valid ranges with end < start; for instance, a valid range with start=43 and end=41 means a niche of 42. Most places in the compiler handle this correctly, but `ty_find_init_error` assumed that `lo > 0` means the type cannot contain a zero. Fix it to handle wrapping ranges.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 24, 2022
Rollup of 11 pull requests Successful merges: - rust-lang#100462 (Clarify `array::from_fn` documentation) - rust-lang#101644 (Document surprising and dangerous fs::Permissions behaviour on Unix) - rust-lang#103005 (kmc-solid: Handle errors returned by `SOLID_FS_ReadDir`) - rust-lang#103140 (Add diagnostic for calling a function with the same name with unresolved Macro) - rust-lang#103254 (rustdoc: do not filter out cross-crate `Self: Sized` bounds) - rust-lang#103347 (bootstrap: also create rustc-src component in sysroot) - rust-lang#103402 (Fix wrapped valid-range handling in ty_find_init_error) - rust-lang#103414 (Pretty print lifetimes captured by RPIT) - rust-lang#103424 (rustdoc: remove no-op CSS `.code-header { border-bottom: none }`) - rust-lang#103434 (Use functions for jump-to-def-background rustdoc GUI test) - rust-lang#103447 (`MaybeUninit`: use `assume_init_drop()` in the partially initialized array example) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rust's niche handling allows for wrapping valid ranges with end < start;
for instance, a valid range with start=43 and end=41 means a niche of
42. Most places in the compiler handle this correctly, but
ty_find_init_error
assumed thatlo > 0
means the type cannot contain azero.
Fix it to handle wrapping ranges.