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 innacuracy in mir TerminatorKind::SwitchInt docs #40576

Merged
merged 1 commit into from
Mar 21, 2017

Conversation

dwrensha
Copy link
Contributor

Each index of values corresponds to an index of targets, and targets additionally has a "default case" element at its end, so targets.len() == values.len() + 1, not the other way around. For example, here is a concrete instance of SwitchInt being constructed with targets.len() == 2 and values.len() == 1.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@nrc
Copy link
Member

nrc commented Mar 17, 2017

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned nrc Mar 17, 2017
@nagisa
Copy link
Member

nagisa commented Mar 18, 2017

r=me

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 20, 2017

📌 Commit e9c07cf has been approved by nikomatsakis

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 21, 2017
…po, r=nikomatsakis

fix innacuracy in mir TerminatorKind::SwitchInt docs

Each index of `values` corresponds to an index of `targets`, and `targets` additionally has a "default case" element at its end, so `targets.len() == values.len() + 1`, not the other way around. For example, [here](https://github.com/rust-lang/rust/blob/0aeb9c12979e6da753701a798d04105b6b1a8c28/src/librustc/mir/mod.rs#L549-L550) is a concrete instance of `SwitchInt` being constructed with `targets.len() == 2` and `values.len() == 1`.
bors added a commit that referenced this pull request Mar 21, 2017
Rollup of 10 pull requests

- Successful merges: #40229, #40312, #40332, #40502, #40556, #40576, #40667, #40671, #40681, #40685
- Failed merges:
@bors bors merged commit e9c07cf into rust-lang:master Mar 21, 2017
@dwrensha dwrensha deleted the mir-terminator-kind-doc-typo branch March 21, 2017 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants