Skip to content

Fix wrapped valid-range handling in ty_find_init_error - #103402

Merged
bors merged 1 commit into
rust-lang:masterfrom
joshtriplett:niche-wrap-fix
Oct 24, 2022
Merged

Fix wrapped valid-range handling in ty_find_init_error#103402
bors merged 1 commit into
rust-lang:masterfrom
joshtriplett:niche-wrap-fix

Conversation

@joshtriplett

Copy link
Copy Markdown
Member

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.

Loading
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants