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

Rewrite a few manual index loops with while-let #73910

Merged
merged 1 commit into from
Jul 2, 2020

Commits on Jul 1, 2020

  1. Rewrite a few manual index loops with while-let

    There were a few instances of this pattern:
    
    ```rust
    while index < vec.len() {
        let item = &vec[index];
        // ...
    }
    ```
    
    These can be indexed at once:
    
    ```rust
    while let Some(item) = vec.get(index) {
        // ...
    }
    ```
    
    Particularly in `ObligationForest::process_obligations`, this mitigates
    a codegen regression found with LLVM 11 (rust-lang#73526).
    cuviper committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    47425e4 View commit details
    Browse the repository at this point in the history