Skip to content

Conversation

gifnksm
Copy link
Contributor

@gifnksm gifnksm commented Apr 7, 2013

uint::range_step or int::range_step causes overflow or underflow as following.
code:

fn main() {
    for uint::range_step(3, 0, -2) |n| {
        println(fmt!("%u", n));
    }
}

output:

3
1
18446744073709551615
18446744073709551613
...

This commit fixes this behavior as follows.

3
1

bors added a commit that referenced this pull request Apr 9, 2013
`uint::range_step` or `int::range_step` causes overflow or underflow as following.
code:
```rust
fn main() {
    for uint::range_step(3, 0, -2) |n| {
        println(fmt!("%u", n));
    }
}
```
output:
```
3
1
18446744073709551615
18446744073709551613
...
```
This commit fixes this behavior as follows.
```
3
1
```
@bors bors closed this Apr 9, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 14, 2020
…=phansch

new lint: match_like_matches_macro

Suggests using the `matches!` macro from `std` where appropriate.

`redundant_pattern_matching` has been moved into the `matches` pass to allow suppressing the suggestion where `is_some` and friends are a better replacement.

changelog: new lint: `match_like_matches_macro`
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.

2 participants