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

Avoid spurious "previous iteration of loop" errors #87998

Merged
merged 1 commit into from
Sep 30, 2021

Commits on Sep 9, 2021

  1. Fix issue rust-lang#72649: avoid spurious "previous iteration of loop…

    …" errors.
    
    Only follow backwards edges during get_moved_indexes if the move path is
    definitely initialized at loop entry. Otherwise, the error occurred prior to the
    loop, so we ignore the backwards edges to avoid generating misleading "value
    moved here, in previous iteration of loop" errors.
    
    This patch also slightly improves the analysis of inits, including
    NonPanicPathOnly initializations (which are ignored by
    drop_flag_effects::for_location_inits). This is required for the definite
    initialization analysis, but may also help find certain skipped reinits in rare
    cases.
    
    Patch passes all non-ignored src/test/ui testcases.
    nneonneo committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    6ff5b47 View commit details
    Browse the repository at this point in the history