Skip to content
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 wrong niche calculation when 2+ niches are placed at the start #90040

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

nbdd0121
Copy link
Contributor

When the niche is at the start, existing code incorrectly uses 1 instead of count for subtraction.

Fix #90038

@rustbot label: T-compiler

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 19, 2021
@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 19, 2021
@oli-obk oli-obk added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 19, 2021
@oli-obk
Copy link
Contributor

oli-obk commented Oct 19, 2021

@bors r+ p=5

@bors
Copy link
Contributor

bors commented Oct 19, 2021

📌 Commit 7dbd5bb has been approved by oli-obk

@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 Oct 19, 2021
@oli-obk oli-obk added beta-accepted Accepted for backporting to the compiler in the beta channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels Oct 19, 2021
@oli-obk
Copy link
Contributor

oli-obk commented Oct 19, 2021

Accepting for beta, as the fix lgtm, is trivial and fixes a soundness problem.

cc @rust-lang/compiler

@oli-obk oli-obk removed the stable-nominated Nominated for backporting to the compiler in the stable channel. label Oct 19, 2021
@bors
Copy link
Contributor

bors commented Oct 19, 2021

⌛ Testing commit 7dbd5bb with merge d45ed75...

@petrochenkov petrochenkov assigned oli-obk and unassigned petrochenkov Oct 19, 2021
@eddyb
Copy link
Member

eddyb commented Oct 19, 2021

(Posted in the issue as well for redundancy)

For the record, while I may have seen #87794 (comment) I do not recall ever reviewing the change it links to (52f4be9), which is where the bug was introduced (I was tipped off by the closures which did not exist in the version of that PR I reviewed).

@bors
Copy link
Contributor

bors commented Oct 19, 2021

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing d45ed75 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 19, 2021
@bors bors merged commit d45ed75 into rust-lang:master Oct 19, 2021
@rustbot rustbot added this to the 1.58.0 milestone Oct 19, 2021
@bonega
Copy link
Contributor

bonega commented Oct 19, 2021

lgtm, sorry for messing up the subtraction.
I should have made unit tests to check boundary logic.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d45ed75): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@nbdd0121 nbdd0121 deleted the issue-90038 branch October 20, 2021 16:29
@Mark-Simulacrum Mark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 22, 2021
@Mark-Simulacrum Mark-Simulacrum modified the milestones: 1.58.0, 1.57.0 Oct 22, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 22, 2021
…ulacrum

[beta] backports

*  Don't emit a warning for empty rmeta files. rust-lang#90072
*  Erase late-bound regions before computing vtable debuginfo name. rust-lang#90050
*  Fix wrong niche calculation when 2+ niches are placed at the start rust-lang#90040
*  Revert rust-lang#86011 to fix an incorrect bound check rust-lang#90025
*  Fix macro_rules! duplication when reexported in the same module rust-lang#89867
* Bump cargo to include rust-lang/cargo#9979 - Fix fetching git repos after a force push.

r? `@Mark-Simulacrum`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. merged-by-bors This PR was explicitly merged by bors. 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.

Miscompilation when awaiting generator containing an enum with niche at least [0, 1]
10 participants