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

False positive for "value never read" warning for while loop with continue #43383

Closed
bennofs opened this issue Jul 21, 2017 · 1 comment
Closed

Comments

@bennofs
Copy link

bennofs commented Jul 21, 2017

Example:

fn main() {
    let mut count = 0;
    while count != 42 {
        count = 42;
        continue
    }
    println!("finished!");
}

Triggers "value assigned to count is never read".

Playground

@bennofs bennofs changed the title False positive for "unused variable" warning for while loop with continue False positive for "value never read" warning for while loop with continue Jul 21, 2017
@retep998
Copy link
Member

Duplicate of #22630

@retep998 retep998 marked this as a duplicate of #22630 Jul 21, 2017
@bennofs bennofs closed this as completed Jul 21, 2017
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

No branches or pull requests

2 participants