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

Rollup of 8 pull requests #117228

Merged
merged 29 commits into from
Oct 26, 2023
Merged

Rollup of 8 pull requests #117228

merged 29 commits into from
Oct 26, 2023

Commits on Oct 18, 2023

  1. refactor(compiler/resolve): simplify some code

    Removes unnecessary allocates and double-sorting the same vector,
    makes the code a little nicer.
    Fenex committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    e68edb8 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2023

  1. mv tests

    estebank committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    855444e View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2023

  1. Avoid unbounded O(n^2) when parsing nested type args

    When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with
    unmatched closing angle brackets, add a linear check that avoids the
    exponential behavior of the parse recovery mechanism.
    
    Fix rust-lang#117080.
    estebank committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    2dec1bc View commit details
    Browse the repository at this point in the history
  2. Add arg_count field to Body in Stable MIR

    This field allows SMIR consumers to identify which locals correspond to
    argument locals. It simply exposes the arg_count field from the MIR
    representation.
    klinvill committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    e4c41b0 View commit details
    Browse the repository at this point in the history
  3. Replace arg_count in public API with return/arg getters

    This commit hides the arg_count field in Body and instead exposes more
    stable and user-friendly methods to get the return and argument locals.
    As a result, Body instances must now be constructed using the `new`
    function.
    klinvill committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    93d1b3e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f4d80a5 View commit details
    Browse the repository at this point in the history
  5. Make locals field private

    klinvill committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    372c533 View commit details
    Browse the repository at this point in the history
  6. Add a public API to get all body locals

    This is particularly helpful for the ui tests, but also could be helpful
    for Stable MIR users who just want all the locals without needing to
    concatenate responses
    klinvill committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    39b293f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    72e8690 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ca29c27 View commit details
    Browse the repository at this point in the history
  9. Move a use to a more sensible spot.

    I.e. in the source file where it's used.
    nnethercote committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    8da1b33 View commit details
    Browse the repository at this point in the history
  10. Tiny comment fixes.

    nnethercote committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    3cf2a74 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e0c990e View commit details
    Browse the repository at this point in the history
  12. Rename internal_locals to inner_locals

    The word internal has connotations about information that's not exposed.
    It's more accurate to say that the remaining locals apply only to the
    inner part of the function, so I'm renaming them to inner locals.
    klinvill committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    fe4dfb8 View commit details
    Browse the repository at this point in the history
  13. Update Place and Operand to take slices

    The latest locals() method in stable MIR returns slices instead of vecs.
    This commit also includes fixes to the existing tests that previously
    referenced the private locals field.
    klinvill committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    4b23bd4 View commit details
    Browse the repository at this point in the history
  14. Add test for smir locals

    klinvill committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    bac7d5b View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2023

  1. The value of -Cinstrument-coverage= doesn't need to be Option

    Not using this flag is identical to passing `-Cinstrument-coverage=off`, so
    there's no need to distinguish between `None` and `Some(Off)`.
    Zalathar committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    9f5fc02 View commit details
    Browse the repository at this point in the history
  2. Revert "Remove TaKO8Ki from reviewers"

    This reverts commit 8e06b25.
    TaKO8Ki committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    ab7f64c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d55487d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d572729 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b1b1458 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#116905 - Fenex:refactor/compiler/resolve, r…

    …=petrochenkov
    
    refactor(compiler/resolve): simplify some code
    
    Removes unnecessary allocate and double-sorting the same vector, makes the code a little nicer.
    matthiaskrgr authored Oct 26, 2023
    Configuration menu
    Copy the full SHA
    17fb2f4 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#117095 - klinvill:smir-fn-arg-count, r=oli-obk

    Add way to differentiate argument locals from other locals in Stable MIR
    
    This PR resolves rust-lang/project-stable-mir#47 which request a way to differentiate argument locals in a SMIR `Body` from other locals.
    
    Specifically, this PR exposes the `arg_count` field from the MIR `Body`. However, I'm opening this as a draft PR because I think there are a few outstanding questions on how this information should be exposed and described. Namely:
    
    - Is exposing `arg_count` the best way to surface this information to SMIR users? Would it be better to leave `arg_count` as a private field and add public methods (e.g. `fn arguments(&self) -> Iter<'_, LocalDecls>`) that may use the underlying `arg_count` info from the MIR body, but expose this information to users in a more convenient form? Or is it best to stick close to the current MIR convention?
    - If the answer to the above point is to stick with the current MIR convention (`arg_count`), is it reasonable to also commit to sticking to the current MIR convention that the first local is always the return local, while the next `arg_count` locals are always the (in-order) argument locals?
    - Should `Body` in SMIR only represent function bodies (as implied by the comment I added)? That seems to be the current case in MIR, but should this restriction always be the case for SMIR?
    
    r? `@celinval`
    r? `@oli-obk`
    matthiaskrgr authored Oct 26, 2023
    Configuration menu
    Copy the full SHA
    b66c6e7 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#117143 - estebank:issue-117080, r=wesleywiser

    Avoid unbounded O(n^2) when parsing nested type args
    
    When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with unmatched closing angle brackets, add a linear check that avoids the exponential behavior of the parse recovery mechanism.
    
    Fix rust-lang#117080, fix rust-lang#115414.
    matthiaskrgr authored Oct 26, 2023
    Configuration menu
    Copy the full SHA
    7eb0548 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#117194 - nnethercote:rustc_incremental, r=c…

    …jgillot
    
    Minor improvements to `rustc_incremental`
    
    Just some things I spotted while looking at this code.
    
    r? `@cjgillot`
    matthiaskrgr authored Oct 26, 2023
    Configuration menu
    Copy the full SHA
    577026c View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#117202 - TaKO8Ki:revert-remove-TaKO8Ki-from…

    …-reviewers, r=Nilstrieb
    
    Revert "Remove TaKO8Ki from reviewers"
    
    ref rust-lang#116061
    
    It's been a month since this pull request, and I now have some available time for reviews. Would it be okay to revisit it as a reviewer?
    
    This reverts commit 8e06b25.
    
    r? `@Nilstrieb`
    matthiaskrgr authored Oct 26, 2023
    Configuration menu
    Copy the full SHA
    36b794e View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#117207 - Zalathar:no-option, r=compiler-errors

    The value of `-Cinstrument-coverage=` doesn't need to be `Option`
    
    (Extracted from rust-lang#117199, since this is a purely internal cleanup that can land independently.)
    
    Not using this flag is identical to passing `-Cinstrument-coverage=off`, so there's no need to distinguish between `None` and `Some(Off)`.
    matthiaskrgr authored Oct 26, 2023
    Configuration menu
    Copy the full SHA
    24bdc37 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#117214 - oli-obk:error_shenanigans, r=compi…

    …ler-errors
    
    Quietly fail if an error has already occurred
    
    fixes rust-lang#117195
    matthiaskrgr authored Oct 26, 2023
    Configuration menu
    Copy the full SHA
    70a4678 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#117221 - fmease:TypeFlags-HAS_TY_GENERATOR-…

    …to-COROUTINE, r=lqd
    
    Rename type flag `HAS_TY_GENERATOR` to `HAS_TY_COROUTINE`
    
    r? oli-obk
    matthiaskrgr authored Oct 26, 2023
    Configuration menu
    Copy the full SHA
    a461de7 View commit details
    Browse the repository at this point in the history