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

accumulate vector and assert for RangeFrom and RangeInclusive examples #35758

Merged

Conversation

matthew-piziak
Copy link
Contributor

@matthew-piziak matthew-piziak commented Aug 17, 2016

PR #35695 for Range was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for RangeFrom and RangeInclusive. It also removes what looks to be an erroneously commented line for #![feature(step_by)], and an unnecessary primitive-type annotation in 0u8...

@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 @alexcrichton (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.

@matthew-piziak
Copy link
Contributor Author

r? @steveklabnik

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Aug 17, 2016

📌 Commit 6c0186d has been approved by GuillaumeGomez

/// println!("{}", i);
/// }
/// let result: Vec<_> = (0..).step_by(2).take(5).collect();
/// assert_eq!(result, vec![0, 2, 4, 6, 8]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think removing the annotation changes it from u8 to implicitly i32, not that it matters.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It simplified the example without harming so I didn't bother with it.

Copy link
Contributor Author

@matthew-piziak matthew-piziak Aug 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry, I should have been clear. Removing the annotation isn't a no-op for the code, but it's unnecessary for explaining the behavior of step_by in this case. A u8 example may be important for explaining overflow behavior though...

@bors
Copy link
Contributor

bors commented Aug 17, 2016

☔ The latest upstream changes (presumably #35747) made this pull request unmergeable. Please resolve the merge conflicts.

@matthew-piziak matthew-piziak force-pushed the vec-assert-over-println-remaining branch from 6c0186d to 95c53b1 Compare August 17, 2016 22:53
@GuillaumeGomez
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Aug 19, 2016

📌 Commit 95c53b1 has been approved by GuillaumeGomez

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 19, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 19, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 20, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
@GuillaumeGomez
Copy link
Member

Please squash your two last commits.

@matthew-piziak matthew-piziak force-pushed the vec-assert-over-println-remaining branch 2 times, most recently from 7636be9 to 28f057d Compare August 23, 2016 21:08
@steveklabnik
Copy link
Member

@bors: r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Aug 25, 2016

📌 Commit 28f057d has been approved by GuillaumeGomez

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Aug 25, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Aug 26, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
@bors
Copy link
Contributor

bors commented Aug 26, 2016

⌛ Testing commit 28f057d with merge 1d3d70e...

@bors
Copy link
Contributor

bors commented Aug 26, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

PR rust-lang#35695 for `Range` was approved, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.

add `fn main` wrappers to enable Rust Playground "Run" button
@matthew-piziak matthew-piziak force-pushed the vec-assert-over-println-remaining branch from 28f057d to 50e0fbc Compare August 26, 2016 15:54
@matthew-piziak
Copy link
Contributor Author

Uh oh. @bors is altering me of a test break. It's one of my changes, but it's not of this PR. It's claiming an unclosed delimiter on this PR: #35863

@GuillaumeGomez
Copy link
Member

Once buildbot is fixed, r+ you get!

@steveklabnik
Copy link
Member

@bors: r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Aug 30, 2016

📌 Commit 50e0fbc has been approved by GuillaumeGomez

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 30, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 30, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 31, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 31, 2016
…tln-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
bors added a commit that referenced this pull request Aug 31, 2016
@bors bors merged commit 50e0fbc into rust-lang:master Aug 31, 2016
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.

7 participants