Skip to content

Silent overflow on debug beta/nightly #36110

Closed
@talchas

Description

@talchas

The standard wishlist

fn main() {
    let mut it = 255u8..;
    println!("{:?}", it.next());
}

no longer panics, but AFAICT from the code this is not due to any deliberate change. The Iterator implementation is start.add_one()/swap, and add_one() is self + 1. This sounds like some overflow checks are being lost somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions