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

⬆️ rust-analyzer #101497

Merged
merged 64 commits into from
Sep 7, 2022
Merged

⬆️ rust-analyzer #101497

merged 64 commits into from
Sep 7, 2022

Commits on Aug 7, 2022

  1. clippy: make generated code nice to read

    Feel free to close if this is too minor.
    kartva committed Aug 7, 2022
    Configuration menu
    Copy the full SHA
    7025502 View commit details
    Browse the repository at this point in the history
  2. more matches! sites

    kartva committed Aug 7, 2022
    Configuration menu
    Copy the full SHA
    a3fc4db View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bcab4be View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2022

  1. Configuration menu
    Copy the full SHA
    581a01d View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2022

  1. Configuration menu
    Copy the full SHA
    6669ea8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7d77775 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2022

  1. Configuration menu
    Copy the full SHA
    dbaf2ce View commit details
    Browse the repository at this point in the history
  2. add type check

    Austaras committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    0dd9eef View commit details
    Browse the repository at this point in the history
  3. update tests

    Austaras committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    f9c180f View commit details
    Browse the repository at this point in the history
  4. change as requested

    Austaras committed Aug 28, 2022
    Configuration menu
    Copy the full SHA
    42486b6 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2022

  1. Auto merge of rust-lang#13056 - DropDemBits:make-refactors, r=Veykril

    internal: Migrate to using format arg captures in `syntax::make`
    bors committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    f02cd0a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    66ec636 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2022

  1. Configuration menu
    Copy the full SHA
    5f132e6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7ecead2 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#13145 - ChayimFriedman2:unmerge-match-arm, r=…

    …jonas-schievink
    
    feat: Add a "Unmerge match arm" assist to split or-patterns inside match expressions
    
    Fixes rust-lang#13072.
    
    The way I implemented it it leaves the `OrPat` in place even if there is only one pattern now but I don't think something will break because of that, and when more code will be typed we'll parse it again anyway. Removing it (but keeping the child pattern) is hard, I don't know how to do that.
    bors committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    989b09d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    45dac9a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    662ab0c View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2022

  1. Use type information to deduce the correct type for "Replace turbofis…

    …h with explicit type", even when it is not exactly the same as the turbofish type
    
    I implemented that by checking the expressions' type.
    This could probably be implemented better by taking the function's return type and substituting the generic parameter with the provided turbofish, but this is more complicated.
    ChayimFriedman2 committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    e5e9799 View commit details
    Browse the repository at this point in the history
  2. Support ? and .await in "Replace turbofish with explicit type"

    Now that we use type information this is easy.
    ChayimFriedman2 committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    bcdacfe View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#13151 - ChayimFriedman2:replace-turbofish-oth…

    …er-type, r=Veykril
    
    Use correct type in "Replace turbofish with type"
    
    And support `?` and `.await` expressions.
    
    Fixes rust-lang#13148.
    
    The assist can still show up even if the turbofish's type is not used at all, e.g.:
    ```rust
    fn foo<T>() {}
    let v = foo::<i32>();
    ```
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    e0e18cc View commit details
    Browse the repository at this point in the history
  4. Drop the expander borrow in all control flow paths

    The change in rust-lang/rust-analyzer#13123
    actually re-uses the RefMut borrow instead of dropping it so we need to
    drop it manually where required.
    Veykril committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    5c0e252 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#13154 - Veykril:ty-mac-expander, r=Veykril

    Drop the expander borrow in all control flow paths
    
    The change in rust-lang/rust-analyzer#13123
    actually re-uses the RefMut borrow instead of dropping it so we need to
    drop it manually where required.
    
    Fixes rust-lang/rust-analyzer#13153
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    ef27641 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#13149 - lowr:fix/unescape-raw-ident-module-pa…

    …th, r=Veykril
    
    fix: unescape all occurrences of module name in module resolution
    
    Fixes rust-lang#13141
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    b613896 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#12793 - lowr:fix/12739, r=Veykril

    fix: sort and deduplicate auto traits in trait object types
    
    Fixes rust-lang#12739
    
    Chalk solver doesn't sort and deduplicate auto traits in trait object types, so we need to handle them ourselves in the lowering phase, just like [`rustc`](https://github.com/rust-lang/rust/blob/880416180b0a9ee1141c07d4d17667edb77daebd/compiler/rustc_typeck/src/astconv/mod.rs#L1487-L1488) and [`chalk-integration`](https://github.com/rust-lang/chalk/blob/master/chalk-integration/src/lowering.rs#L575) do.
    
    Quoting from [the Chalk book](https://rust-lang.github.io/chalk/book/types/rust_types.html#dyn-types):
    
    > Note that -- for this purpose -- ordering of bounds is significant. That means that if you create a `dyn Foo + Send` and a `dyn Send + Foo`, chalk would consider them distinct types. The assumption is that bounds are ordered in some canonical fashion somewhere else.
    
    Also, trait object types with more than one non-auto traits were previously allowed, but are now disallowed with this patch.
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    56d8886 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#12963 - DesmondWillowbrook:clippy-matches-sou…

    …rcegen, r=Veykril
    
    clippy: make generated code nice to read
    
    Feel free to close if this is too minor.
    
    (For context, I _have_ read the clippy policy in `dev/style.md`)
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    d9e2207 View commit details
    Browse the repository at this point in the history
  9. change title

    Austaras committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    43e8d96 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    4661a60 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a5d2463 View commit details
    Browse the repository at this point in the history
  12. feature: Simplfy branch check logics

    Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
    pocket7878 and Veykril committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    5a1b45d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    7464b6d View commit details
    Browse the repository at this point in the history
  14. Auto merge of rust-lang#13051 - DropDemBits:attrs-and-comments-on-enu…

    …m-variant, r=jonas-schievink
    
    fix: Only move comments when extracting a struct from an enum variant
    
    Motivating example:
    
    ```rs
    #[derive(Debug, thiserror::Error)]
    enum Error {
        /// Some explanation for this error
        #[error("message")]
        $0Woops {
            code: u32
        }
    }
    ```
    now becomes
    ```rs
    /// Some explanation for this error
    #[derive(Debug, thiserror::Error)]
    struct Woops{
        code: u32
    }
    
    #[derive(Debug, thiserror::Error)]
    enum Error {
        #[error("message")]
        Woops(Woops)
    }
    ```
    (the `thiserror::Error` derive being copied and the struct formatting aren't ideal, though those are issues for another day)
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    cf05b7d View commit details
    Browse the repository at this point in the history
  15. Auto merge of rust-lang#13005 - pocket7878:convert-two-arm-bool-match…

    …-to-matches-macro, r=jonas-schievink
    
    feature: Assist to turn match into matches! invocation
    
    Resolves rust-lang#12510
    
    This PR adds an assist, which convert 2-arm match that evaluates to a boolean into the equivalent matches! invocation.
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    79a578a View commit details
    Browse the repository at this point in the history
  16. Auto merge of rust-lang#13120 - Austaras:master, r=jonas-schievink

    turn `unwrap_or` into `unwrap_or_else` and vice versa
    
    closes rust-lang#12983
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    7f38581 View commit details
    Browse the repository at this point in the history
  17. Remove hir::Expr::MacroStmts

    This hir expression isn't needed and only existed as it was simpler to
    deal with at first as it gave us a direct mapping for the ast version of
    the same construct. This PR removes it, properly handling the statements
    that are introduced by macro call expressions.
    Veykril committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    192a79c View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    1a580a3 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    ee02a47 View commit details
    Browse the repository at this point in the history
  20. Auto merge of rust-lang#13156 - Veykril:macro-stmts, r=Veykril

    Remove hir::Expr::MacroStmts
    
    This hir expression isn't needed and only existed as it was simpler to
    deal with at first as it gave us a direct mapping for the ast version of
    the same construct. This PR removes it, properly handling the statements
    that are introduced by macro call expressions.
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    ab068f1 View commit details
    Browse the repository at this point in the history
  21. Correct visibility check

    iDawer committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    1fa9d5e View commit details
    Browse the repository at this point in the history
  22. Auto merge of rust-lang#13134 - Veykril:proc-highlight, r=Veykril

    Highlight namerefs by syntax until proc-macros have been loaded
    
    Usually when loading up a project, once loading is done we start answering highlight requests while proc-macros haven't always been loaded yet, so we start out with showing a lot of unresolved name-refs. After this PR, we'll use syntax based highlighting for those unresolved namerefs until the proc-macros have been loaded.
    bors committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    643c3a5 View commit details
    Browse the repository at this point in the history
  23. Parse TypePathFn with preceding ::

    e.g. `impl Fn::() -> ()`.
    ChayimFriedman2 committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    d786a40 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2022

  1. Configuration menu
    Copy the full SHA
    2eec4ed View commit details
    Browse the repository at this point in the history
  2. Simplify breakables handling

    Veykril committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    d6fc4a9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1e66a5a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8110119 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c6b7f45 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#13165 - Veykril:breakables, r=Veykril

    Properly handle break resolution inside non-breakable expressions
    
    We now diagnose invalid `continue` expressions and properly handle things like `async` blocks which prevent labels from resolving further. Cleaned this up since `label_break_value` is on the way to stabilization in rust (🎉 finally) and we weren't handling breaks for blocks properly yet.
    bors committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    c4445e4 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#13161 - ChayimFriedman2:pi-is-zero, r=jonas-s…

    …chievink
    
    fix: Lower float literals with underscores
    
    Fixes rust-lang#13155 (the problem was the `PI` is defined with `_f64` suffix). `PI` is still truncated, though, because `f64` cannot represent the value with full precision.
    bors committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    f23114c View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#13160 - ChayimFriedman2:parse-parenthesized-t…

    …ype-path-with-coloncolon, r=jonas-schievink
    
    fix: Parse TypePathFn with preceding `::`
    
    e.g. `impl Fn::() -> ()`.
    
    Fixes rust-lang#13157. This was the problem, not that the path was not at the end.
    
    I could unify the parsing of `::` of TypePathFn with that of generic arg list, but some code relies on the `::` of generic arg list to be inside it.
    bors committed Sep 1, 2022
    Configuration menu
    Copy the full SHA
    93c52e4 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2022

  1. Configuration menu
    Copy the full SHA
    61ad33d View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13171 - matklad:open-failure, r=lnicola

    internal: ignore failures when publishing to ovsx
    
    This has been failing for a while
    
    https://github.com/rust-lang/rust-analyzer/runs/8147683225?check_suite_focus=true#step:24:19
    bors committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    412d614 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8ae58b9 View commit details
    Browse the repository at this point in the history
  4. Add docs

    iDawer committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    ffd79c2 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#13167 - iDawer:exhaustive_patterns, r=Veykril

    feat: Implement `feature(exhaustive_patterns)` from unstable Rust
    
    Closes rust-lang#12753
    
    Recognize Rust's unstable `#![feature(exhaustive_patterns)]` (RFC 1872). Allow omitting visibly uninhabited variants from `match` expressions when the feature is on.
    
    This adjusts match checking to the current implementation of the postponed RFC 1872 in rustc.
    bors committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    4f8153e View commit details
    Browse the repository at this point in the history
  6. Don't store SyntheticSyntax in the reverse maps in BodySourceMap

    They are ZSTs which we can just create on missing access instead.
    Veykril committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    fe0a106 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#13173 - Veykril:synthetic, r=Veykril

    Don't store SyntheticSyntax in the reverse maps in BodySourceMap
    
    They are ZSTs which we can just create on missing access instead.
    bors committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    2bb6635 View commit details
    Browse the repository at this point in the history
  8. Lift out the module scope into a field in the Resolver

    A Resolver *always* has a module scope at the end of its scope stack,
    instead of encoding this as an invariant we can just lift this scope
    out into a field, allowing us to skip going through the scope vec
    indirection entirely.
    Veykril committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    8828049 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#13174 - Veykril:resolver, r=Veykril

    Lift out the module scope into a field in the Resolver
    
    A Resolver *always* has a module scope at the end of its scope stack,
    instead of encoding this as an invariant we can just lift this scope
    out into a field, allowing us to skip going through the scope vec
    indirection entirely.
    bors committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    f27f98d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    894aa0e View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#13175 - Veykril:resolver, r=Veykril

    Clarify the state of (extern) preludes for block def maps
    bors committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    afa374e View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2022

  1. Configuration menu
    Copy the full SHA
    020f689 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13183 - Veykril:break-break, r=Veykril

    Fix nested break expressions, expecting unknown types
    bors committed Sep 3, 2022
    Configuration menu
    Copy the full SHA
    8ddb8b7 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2022

  1. fix: correct broken logic for return complition

    It seems that we've accidentally deleted the tests here couple of years
    ago, and then fairly recently made a typo during refactor as well.
    
    Reinstall tests, with coverage marks this time :-)
    matklad committed Sep 4, 2022
    Configuration menu
    Copy the full SHA
    d7ef3f5 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13187 - matklad:return, r=Veykril

    fix: correct broken logic for return complition
    
    It seems that we've accidentally deleted the tests here couple of years
    ago, and then fairly recently made a typo during refactor as well.
    
    Reinstall tests, with coverage marks this time :-)
    bors committed Sep 4, 2022
    Configuration menu
    Copy the full SHA
    67920f7 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2022

  1. ⬆️ rust-analyzer

    lnicola committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    d058800 View commit details
    Browse the repository at this point in the history