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 #109069

Merged
merged 169 commits into from
Mar 13, 2023
Merged

⬆️ rust-analyzer #109069

merged 169 commits into from
Mar 13, 2023

Commits on Feb 17, 2023

  1. add openDocs to context menu. add further restrictions to context men…

    …u when clauses to prevent irrelevant commands in non-rust files
    jmviz committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    ed1f467 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2023

  1. Refactor

    - Remove unnecessary references and derefs
    - Manual formatting
    lowr committed Feb 19, 2023
    Configuration menu
    Copy the full SHA
    4438017 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    83e24fe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2351875 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d416623 View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2023

  1. ⬆️ rust-analyzer

    lnicola committed Feb 20, 2023
    Configuration menu
    Copy the full SHA
    7e711da View commit details
    Browse the repository at this point in the history
  2. add to manual

    jmviz committed Feb 20, 2023
    Configuration menu
    Copy the full SHA
    dd92e4a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7b5cfdd View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2023

  1. Configuration menu
    Copy the full SHA
    549b53b View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14181 - lnicola:sync-from-rust, r=lnicola

    minor: Sync from downstream
    bors committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    dad6b14 View commit details
    Browse the repository at this point in the history
  3. Remove file added by mistake

    lnicola committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    f40526b View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#14182 - lnicola:rm-profdata, r=lnicola

    minor: Remove file added by mistake
    
    This got added somehow in rust-lang/rust-analyzer#14154.
    bors committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    e59ada9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    563bd9c View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#14183 - lnicola:rustfmt-command-docs, r=lowr

    minor: Try to improve the `rustfmt.overrideCommand` docs
    
    Closes rust-lang#14078
    bors committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    27239fb View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2023

  1. Rename many interner functions.

    (This is a large commit. The changes to
    `compiler/rustc_middle/src/ty/context.rs` are the most important ones.)
    
    The current naming scheme is a mess, with a mix of `_intern_`, `intern_`
    and `mk_` prefixes, with little consistency. In particular, in many
    cases it's easy to use an iterator interner when a (preferable) slice
    interner is available.
    
    The guiding principles of the new naming system:
    - No `_intern_` prefixes.
    - The `intern_` prefix is for internal operations.
    - The `mk_` prefix is for external operations.
    - For cases where there is a slice interner and an iterator interner,
      the former is `mk_foo` and the latter is `mk_foo_from_iter`.
    
    Also, `slice_interners!` and `direct_interners!` can now be `pub` or
    non-`pub`, which helps enforce the internal/external operations
    division.
    
    It's not perfect, but I think it's a clear improvement.
    
    The following lists show everything that was renamed.
    
    slice_interners
    - const_list
      - mk_const_list -> mk_const_list_from_iter
      - intern_const_list -> mk_const_list
    - substs
      - mk_substs -> mk_substs_from_iter
      - intern_substs -> mk_substs
      - check_substs -> check_and_mk_substs (this is a weird one)
    - canonical_var_infos
      - intern_canonical_var_infos -> mk_canonical_var_infos
    - poly_existential_predicates
      - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter
      - intern_poly_existential_predicates -> mk_poly_existential_predicates
      - _intern_poly_existential_predicates -> intern_poly_existential_predicates
    - predicates
      - mk_predicates -> mk_predicates_from_iter
      - intern_predicates -> mk_predicates
      - _intern_predicates -> intern_predicates
    - projs
      - intern_projs -> mk_projs
    - place_elems
      - mk_place_elems -> mk_place_elems_from_iter
      - intern_place_elems -> mk_place_elems
    - bound_variable_kinds
      - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter
      - intern_bound_variable_kinds -> mk_bound_variable_kinds
    
    direct_interners
    - region
      - intern_region (unchanged)
    - const
      - mk_const_internal -> intern_const
    - const_allocation
      - intern_const_alloc -> mk_const_alloc
    - layout
      - intern_layout -> mk_layout
    - adt_def
      - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid)
      - alloc_adt_def(!) -> mk_adt_def
    - external_constraints
      - intern_external_constraints -> mk_external_constraints
    
    Other
    - type_list
      - mk_type_list -> mk_type_list_from_iter
      - intern_type_list -> mk_type_list
    - tup
      - mk_tup -> mk_tup_from_iter
      - intern_tup -> mk_tup
    nnethercote committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    888c18d View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2023

  1. Auto merge of rust-lang#14175 - jmviz:openDocs-context-menu, r=lnicola

    add openDocs command to context menu in VS Code extension
    
    This adds the `openDocs` command to the VS Code context menu. I believe there are probably many user who are unaware of this command existing in the rust analyzer extension, and that this should enhance the discoverability of the command. Additionally, even if people are aware of this capability, it's helpful to have this in the context menu anyway; for example, one might forget the name of the command, or the keybinding they have assigned to it. I think that opening docs is a common enough action to warrant the extra line added to the context menu.
    
    This makes a few other small changes as well. There are two minor style changes to increase style consistency. First, it changes the titles of the two commands that the rust analyzer extension will contribute to the context menu to title case. All standard VS Code commands that appear in the context menu are in title case. Second, it shortens the title of the `openDocs` command from `Open docs under cursor` to `Open Docs`. The implicit assumption in the standard VS Code context menu command titles is that the action applies to the symbol under the cursor: `Go to Definition`, `Find All References`, etc. Note that since these are changes to the command titles, rather than the command names themselves, these changes will not break any users' existing keybindings for these commands.
    
    Second, this adds further restrictions to the `where` clauses of the two commands that the rust analyzer extension will contribute to the context menu, so that the two commands will appear in the context menu only when in a Rust project **and** within a Rust file. Say you have a Python or bash script inside your Rust project. Having these commands appear in the context menu when you right click a symbol in such a non-Rust file is extraneous and potentially confusing.
    
    ![demonstration](https://user-images.githubusercontent.com/6609145/219976062-b46ab21b-5753-48f5-a1da-562566cae71c.gif)
    bors committed Feb 24, 2023
    Configuration menu
    Copy the full SHA
    f5401f6 View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2023

  1. minor: import Either from either

    lowr committed Feb 25, 2023
    Configuration menu
    Copy the full SHA
    cf0c8fe View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14202 - lowr:minor/use-either-either, r=lnicola

    minor: import `Either` from `either`
    
    This is a clean-up patch to replace `use itertools::Either` with `use either::Either` for the sake of consistency.
    bors committed Feb 25, 2023
    Configuration menu
    Copy the full SHA
    9a4efb4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    44e47fe View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#14203 - shilangyu:fix/angled-path-segments, r…

    …=lnicola
    
    fix: Add check for extra path segments after a fully qualified one
    
    `type A = <()>;` is parsed just fine by rust-analyzer, but then rejected by rustc:
    
    ```
    error: expected `::`, found `;`
     --> x.rs:7:14
      |
    7 | type A = <()>;
      |              ^ expected `::`
    
    ```
    
    Fixed by adding a lookahead for the `::` token after fully-qualified path segments.
    bors committed Feb 25, 2023
    Configuration menu
    Copy the full SHA
    289208b View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2023

  1. Configuration menu
    Copy the full SHA
    e4b184a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aa87764 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#14207 - tomokinat:master, r=lnicola

    Respect $CARGO_HOME when looking up toolchains.
    
    Some people set `$CARGO_HOME` to a location other than `~/.cargo` (`$XDG_DATA_DIR/cargo`,  in my case), and I'd be a little nicer if the rust-analyzer extension and server respect that value when looking up toolchains, instead of having us configure all of `$CARGO`, `$RUSTC` ... manually.
    
    The new implementation still defaults to `~/.cargo` if `$CARGO_HOME` is unset, pretty much like cargo itself does (as documented in https://doc.rust-lang.org/cargo/guide/cargo-home.html), so the change is backwards compatible for most people except those who has configured `$CARGO_HOME` explicitly.
    
    I considered using https://crates.io/crates/home as suggested by https://doc.rust-lang.org/cargo/guide/cargo-home.html, but decided to put int on hold because i) we need mirror impl in node, ii) I thought the consistency matters more and iii) the new implementation shouldn't be worse than the current one (i.e. switching to `home` improvement is rather orthogonal and could be done in another PR). If you have any directions on this, please let me know.
    bors committed Feb 26, 2023
    Configuration menu
    Copy the full SHA
    4e29820 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2023

  1. Configuration menu
    Copy the full SHA
    9a481d1 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14208 - Kohei316:master, r=Veykril

    fix:add a case in which remainig is None in resolveing types when resolving hir path.
    
    fix rust-lang#14030 The variable type is being determined incorrectly
    This PR fixed a problem in which `go to definition` is jumping to the incorrect position because it was failing to resolve the type in case it defined in the module when resolving hir.
    In addition, I added a test for this issue and refactored the related code.
    This is my first PR and I am using a translation tool to write this text. Let me know if you have any problems.
    bors committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    2e47915 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    832f8bf View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#14213 - swarnimarun:raw-ptr-ty, r=Veykril

    add: clean api to get `raw_ptr` type
    
    There doesn't seem to be an API to fetch the type of `raw_ptr`, which is helpful for a project I work on.
    
    Notes:
    
    - I am unsure about the function name, do let me know if I should use something else.
    - Also unsure about where to add tests, for hir changes. Will fix it as needed.
    bors committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    b38fcde View commit details
    Browse the repository at this point in the history
  5. Simplify

    Veykril committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    9e5fa74 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    29a4453 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#14216 - Veykril:simplify, r=Veykril

    minor: Simplify
    bors committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    c867cbf View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9942cc4 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8bc75c4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9957bb3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    4ee2e46 View commit details
    Browse the repository at this point in the history
  12. Add const to doctest runnable definition

    Refactor method to get type parameters to add const parameters
    Remove unused methods
    anergictcell committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    7abcc7d View commit details
    Browse the repository at this point in the history
  13. Remove empty line

    anergictcell committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    f494d11 View commit details
    Browse the repository at this point in the history
  14. beginning of MIR

    HKalbasi committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    cd67589 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2023

  1. Auto merge of rust-lang#14040 - HKalbasi:mir, r=HKalbasi

    Beginning of MIR
    
    This pull request introduces the initial implementation of MIR lowering and interpreting in Rust Analyzer.
    
    The implementation of MIR has potential to bring several benefits:
    - Executing a unit test without compiling it: This is my main goal. It can be useful for quickly testing code changes and print-debugging unit tests without the need for a full compilation (ideally in almost zero time, similar to languages like python and js). There is a probability that it goes nowhere, it might become slower than rustc, or it might need some unreasonable amount of memory, or we may fail to support a common pattern/function that make it unusable for most of the codes.
    - Constant evaluation: MIR allows for easier and more correct constant evaluation, on par with rustc. If r-a wants to fully support the type system, it needs full const eval, which means arbitrary code execution, which needs MIR or something similar.
    - Supporting more diagnostics: MIR can be used to detect errors, most famously borrow checker and lifetime errors,  but also mutability errors and uninitialized variables, which can be difficult/impossible to detect in HIR.
    - Lowering closures: With MIR we can find out closure capture modes, which is useful in detecting if a closure implements the `FnMut` or `Fn` traits, and calculating its size and data layout.
    
    But the current PR implements no diagnostics and doesn't support closures. About const eval, I removed the old const eval code and it now uses the mir interpreter. Everything that is supported in stable rustc is either implemented or is super easy to implement. About interpreting unit tests, I added an experimental config, disabled by default, that shows a `pass` or `fail` on hover of unit tests (ideally it should be a button similar to `Run test` button, but I didn't figured out how to add them). Currently, no real world test works, due to missing features including closures, heap allocation, `dyn Trait` and ... so at this point it is only useful for me selecting what to implement next.
    
    The implementation of MIR is based on the design of rustc, the data structures are almost copy paste (so it should be easy to migrate it to a possible future stable-mir), but the lowering and interpreting code is from me.
    bors committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    a0be16b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    af79491 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#14185 - anergictcell:fix_14142, r=HKalbasi

    Fix: Run doctests for structs with lifetime parameters from IDE
    
    Fixes rust-lang#14142: Doctests can't be triggered for structs with lifetimes
    
    This MR adds lifetime parameters to the structs path for runnables so that they can be triggered from an IDE as well.
    
    This is my first MR for rust-analyzer, please let me know if I should change something, either in code or the description here.
    bors committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    c386316 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    47a567b View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#14218 - Veykril:root-dedup, r=Veykril

    Deduplicate source roots that have overlapping include paths
    
    Fixes flycheck not working for the rustc workspace when using `linkedProjects`
    bors committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    1d07c5b View commit details
    Browse the repository at this point in the history
  6. Don't use unstable pointer link

    lowr committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    b5a1ddf View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#14220 - lowr:fix/ci-pointer-offset-is-unstabl…

    …e, r=lnicola
    
    minor: Don't use unstable `pointer` link
    
    Our CI is failing because rustdoc is complaining we're using [unstable](rust-lang#80896) `pointer` link.
    bors committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    7f01ae8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f64fe66 View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2023

  1. Configuration menu
    Copy the full SHA
    de4a896 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14225 - lowr:patch/remove-nested-dbg, r=Veykril

    Support removing nested `dbg!()`s in `remove_dbg`
    
    Closes rust-lang#13901
    bors committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    d1fd635 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#14223 - HKalbasi:mir, r=HKalbasi

    Add tuple to render_const_scalar
    
    cc `@lowr`
    bors committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    ef9d5db View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#14176 - lowr:fix/assoc-func-vis-in-local-impl…

    …, r=Veykril
    
    Fix associated item visibility in block-local impls
    
    Fixes rust-lang#14046
    
    When we're resolving visibility of block-local items...
    
    > `self` normally refers to the containing non-block module, and `super` to its parent (etc.). However, visibilities must only refer to a module in the DefMap they're written in, so we restrict them when that happens. ([link])
    
     ...unless we're resolving visibility of associated items in block-local impls, because that impl is semantically "hoisted" to the nearest (non-block) module. With this PR, we skip the adjustment for such items.
    
    Since visibility representation of those items is modified, this PR also adjusts visibility rendering in `HirDisplay`.
    
    [link]: https://github.com/rust-lang/rust-analyzer/blob/a6603fc21d50b3386a488c96225b2d1fd492e533/crates/hir-def/src/nameres/path_resolution.rs#L101-L103
    bors committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    32424d0 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2023

  1. Configuration menu
    Copy the full SHA
    88f2abb View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14234 - Veykril:rustc-crate-check, r=Veykril

    Don't drop rustc crates in the rustc workspace
    
    Turns out the rustc workspace has tools that rely on the external crates themselves so this check is faulty
    bors committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    9b441b9 View commit details
    Browse the repository at this point in the history
  3. Fix typo

    lowr committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    943de55 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2023

  1. Configuration menu
    Copy the full SHA
    bda2af7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fc2b395 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ec273c3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    44e2c6e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    522823f View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#14238 - lowr:feat/allow-generate-fn-across-lo…

    …cal-crates, r=Veykril
    
    feat: allow `generate_function` to generate in different local crate
    
    Closes rust-lang#14224
    
    This PR allows `generate_function` assist to generate in crates other than the current one. I took a step further from the original request and made it allow to generate in any local crates since it looked reasonable and IDE layer doesn't really know about packages.
    
    (actually we have been checking which crate we're generating in only for methods and not for freestanding functions, so we were providing the assist for `std::foo$0()`; it's both feature and fix in a sense)
    
    The first commit is a drive-by fix unrelated to the feature.
    bors committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    3b857e1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    80ddfb8 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#14222 - Veykril:pat-mismatch-diags, r=Veykril

    Show pattern mismatch diagnostics
    bors committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    c229a83 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#14239 - Veykril:sysroot-cli, r=Veykril

    fix: Load the sysroot in all CLI commands
    bors committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    a8d3c46 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2e7d2c2 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    356d12e View commit details
    Browse the repository at this point in the history
  12. Refactor generic parameter lowering

    Since we moved impl trait handling to other place, there are only two
    cases now: those that introduce implicit `Self` parameter and those that
    don't.
    lowr committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    e2ec3a6 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    29c957f View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    f8eac19 View commit details
    Browse the repository at this point in the history
  15. Auto merge of rust-lang#14184 - lowr:feat/trait-alias-def, r=Veykril

    Handle trait alias definitions
    
    Part of rust-lang#2773
    
    This PR adds a bunch of structs and enum variants for trait aliases. Trait aliases should be handled as an independent item because they are semantically distinct from traits.
    
    I basically started by adding `TraitAlias{Id, Loc}` to `hir_def::item_tree` and iterated adding necessary stuffs until compiler stopped complaining what's missing. Let me know if there's still anything I need to add.
    
    I'm opening up this PR for early review and stuff. I'm planning to add tests for IDE functionalities in this PR, but not type-related support, for which I put FIXME notes.
    bors committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    6756294 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    02eb2d7 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    41f234d View commit details
    Browse the repository at this point in the history
  18. Auto merge of rust-lang#14240 - Veykril:coerce-many, r=Veykril

    Diagnose value breaks in incorrect breakables
    bors committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    3ba876a View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3c7a0aa View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    78b2dd8 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    e7485a0 View commit details
    Browse the repository at this point in the history
  22. Auto merge of rust-lang#14243 - Veykril:inference-diags, r=Veykril

    feat: Diagnose unresolved field, method call and call expression
    bors committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    7c092a1 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    c12fac6 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    29150c2 View commit details
    Browse the repository at this point in the history
  25. Auto merge of rust-lang#14245 - Veykril:pat-diags, r=Veykril

    Disable pattern type mismatches again
    
    We have too many false mismatches at the moment for these to be enabled
    cc rust-lang/rust-analyzer#14222
    bors committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    73e2505 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2023

  1. generate correct completion edits for missing macro arguments

    rust-analyzer used the token at the cursor after macro expansion
    to decide whether to replace the token at the cursor before macro
    expansion. In most cases these two are the same but in some cases these
    can mismatch which can lead to incorrect replacements.
    
    For example if an ident/expr macro argument is missing rust-analyzer
    generates a "missing" identifier as a placeholder, there is only a
    brace at the cursor. Therefore, rust-analyzer will incorrectly replace
    the macro brace with the completion in that case leading to rust-lang#14246.
    
    Using the expanded token type was intentional. However, this doesn't
    seem to ever be desirable (this is supported by the fact that there
    were no tests that relied on this behavior) since the type of edit to
    perform should always be determined by the token it's actually applied
    to.
    pascalkuthe committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    2e465d1 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14247 - pascalkuthe:master, r=Veykril

    generate correct completion edits for missing macro arguments
    
    Fixes rust-lang#14246
    
    rust-analyzer used the token at the cursor after macro expansion to decide whether to replace the token at the cursor before macro expansion. In most cases these two are the same but in some cases these can mismatch which can lead to incorrect replacements.
    
    For example if an ident/expr macro argument is missing rust-analyzer generates a "missing" identifier as a placeholder, there is only a brace at the cursor. Therefore, rust-analyzer will incorrectly replace the macro brace with the completion in that case leading to rust-lang#14246.
    
    Using the expanded token type was intentional. However, this doesn't seem to ever be desirable (this is supported by the fact that there were no tests that relied on this behavior) since the type of edit to perform should always be determined by the token it's actually applied to. Therefore this PR simply switches the relevant match to use the unexpanded token instead
    bors committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    4b330f5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    800ab65 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#14244 - Veykril:metrics, r=lnicola

    internal: Report type metrics for patterns
    
    ```
    ❯ cargo run --release -p rust-analyzer -q analysis-stats --memory-usage .
    Database loaded:     2.09s, 218mb (metadata 275.07ms, 21mb; build 1.29s, 504kb)
      crates: 44, mods: 916, decls: 19582, fns: 14631
    Item Collection:     14.33s, 472mb
      exprs: 420422, ??ty: 68 (0%), ?ty: 141 (0%), !ty: 1
      pats: 82968, ??ty: 11 (0%), ?ty: 10 (0%), !ty: 178
    Inference:           47.84s, 745mb
    Total:               62.16s, 1217mb
    ```
    We currently have 178 mismatches on r-a itself
    bors committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    5efcfe5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    24ba1be View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1b5bc83 View commit details
    Browse the repository at this point in the history
  7. Fix extract_variable test

    Veykril committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    b827648 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    95c4cb9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b85e2af View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#14251 - Veykril:ty-expr-stmt, r=Veykril

    internal: Set expectation for no-semi expression statements to unit
    bors committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    94dc7a3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5a91f01 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#14252 - Veykril:field-mcall-fallback, r=Veykril

    internal: Handle fields called as method calls as the fields they resolve to
    
    Confusing PR title tbf but this makes it so `bar` in `foo.bar()` resolves to the field if it exists and no method with the same name exists. Improves UX slightly when incorrectly calling a field.
    bors committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    e6ba791 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2023

  1. Auto merge of rust-lang#101550 - CraftSpider:link-dead-windows, r=wes…

    …leywiser
    
    Make compressed rmeta contain compressed data length after header
    
    Fixes rust-lang#90056, which is caused by link.exe introducing padding to the `.rustc` section, since it assumes this will have no effect besides allowing it to possibly use the extra space in future links.
    bors committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    15b867b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ae8ce99 View commit details
    Browse the repository at this point in the history
  3. Re-use the resolver in InferenceContext instead of rebuilding it on e…

    …very expression change
    Veykril committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    a8606e5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a51267c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    27fad2a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d8b1ec6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7be48ac View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#14255 - HKalbasi:const-hex, r=HKalbasi

    Bring back the hex in const hover
    bors committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    0a956ec View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2023

  1. Auto merge of rust-lang#14260 - Veykril:if-let-match-adjust, r=Veykril

    fix: Adjust `replace_match_with_if_let` applicability range
    
    It currently trigger in the entirety of match which is less than ideal
    bors committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    900efbe View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14261 - Veykril:ty-perf, r=Veykril

    internal: Re-use the resolver in `InferenceContext` instead of rebuilding it whenever needed
    
    This reduced inference time on my local build by roughly ~1 sec (out of like 60)
    bors committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    a360fab View commit details
    Browse the repository at this point in the history
  3. Add BindingId

    HKalbasi committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    61ad6a9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c0a0664 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a25710b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ac04bfd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6377d50 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bf0f99f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    af90ec8 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2cce9dc View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    199bc82 View commit details
    Browse the repository at this point in the history
  12. internal: Mark unresolved field, unresolved method and expected funct…

    …ion diagnostics experimental
    Veykril committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    34a3187 View commit details
    Browse the repository at this point in the history
  13. Auto merge of rust-lang#14267 - Veykril:experimental-diagnostics, r=V…

    …eykril
    
    internal: Mark unresolved field, unresolved method and expected function diagnostics experimental
    
    Our type checking is still not good enough for us to have these diagnostics be enabled by default it seems so let's mark them as experimental for now.
    bors committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    1bfe96e View commit details
    Browse the repository at this point in the history
  14. Fix inlay-hint tests

    Veykril committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    0ce0608 View commit details
    Browse the repository at this point in the history
  15. Auto merge of rust-lang#14266 - Veykril:generalize-eager-lazy, r=Veykril

    feature: Make replace_or_with_or_else assists more generally applicable
    bors committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    31c12ec View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2023

  1. Configuration menu
    Copy the full SHA
    995aacf View commit details
    Browse the repository at this point in the history
  2. add more tests

    xffxff committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    98990af View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bcd7ecb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6e97527 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#14232 - HKalbasi:mir, r=Veykril

    MIR episode 2
    
    This PR adds:
    1. `need-mut` and `unused-mut` diagnostics
    2. `View mir` command which shows MIR for the body under cursor, useful for debugging
    3. MIR lowering for or-patterns and for-loops
    bors committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    44ff3c4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d45708f View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#14271 - Veykril:ty-diag-err, r=Veykril

    Don't trigger unresolved method/field diagnostics on types containing errors
    bors committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    ecc32c2 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2023

  1. Configuration menu
    Copy the full SHA
    c978648 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14248 - XFFXFF:let_else_right_curly_brace, r=…

    …Veykril
    
    fix: show diagnostic for } token followed by else in let else statement
    
    fix rust-lang#14221
    
    My thinking is to check if the `expr` after `=` is block like when parse `let ... lese` , and if so, emit error.
    bors committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    a9d97b6 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#14282 - Veykril:rustc_private-proc-macro, r=V…

    …eykril
    
    fix: Load proc-macros for rustc_private crates
    
    Fixes rust-lang/rust-analyzer#13591
    
    Verified that this makes things work in the clippy repo (like resolving `sym` things for example)
    bors committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    aff6cb0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b4bd27b View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#14283 - Veykril:error-notifs, r=Veykril

    Load proc-macros for rustc_private crates
    
    If the client support our server status notification there is no need to show the pop up for workspace fetching failures since that's already going to be shown in the status.
    cc rust-lang/rust-analyzer#14193
    bors committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    6ebbd48 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b6e7cf3 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#14284 - Veykril:sem-derive-unresolved, r=Veykril

    fix: Highlight unresolved derives as being unresolved
    
    Fixes rust-lang/rust-analyzer#11350
    bors committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    c951093 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cf47c15 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#14285 - HKalbasi:mir, r=Veykril

    Evaluate consts in `path_to_const`
    
    fix rust-lang#14275
    bors committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    db64f3a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d038892 View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#14286 - Veykril:block-def-tail-mac, r=Veykril

    fix: Fix block defmap not looking into tail expressions for macro calls
    
    Fixes rust-lang/rust-analyzer#14263
    bors committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    3d904e0 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4ee2aba View commit details
    Browse the repository at this point in the history
  13. Auto merge of rust-lang#14287 - Veykril:rustc_private-proc-macro, r=V…

    …eykril
    
    minor: Fixup dylib extensions for rustc_private proc-macro loading
    
    Follow up to rust-lang/rust-analyzer#14282
    bors committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    38e9a11 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    811190b View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2023

  1. Auto merge of rust-lang#14291 - HKalbasi:master, r=HKalbasi

    fix multiple definition binding in match to let-else
    
    fix rust-lang#14290
    bors committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    8e404f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d8c80e7 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#14297 - Veykril:proc-macro-deps, r=Veykril

    Add core lib to proc_macro dependencies
    
    Fixes rust-lang/rust-analyzer#14292
    bors committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    a738737 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e158dc7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3427d36 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#14299 - Veykril:local-search, r=Veykril

    fix: Fix search not searching bodies of attributed items
    
    Closes rust-lang/rust-analyzer#14229
    bors committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    de3b12d View commit details
    Browse the repository at this point in the history
  7. minor: Remove dead code

    Veykril committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    879cac4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    209cf7d View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#14300 - lnicola:rustc-flycheck, r=lnicola

    fix: Watch both stdout and stderr in flycheck
    
    Fixes rust-lang#14217
    
    This isn't great because it un-mixes the messages from the two streams, but maybe it's not such a big problem?
    bors committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    10a652a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c49f753 View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#14302 - Veykril:db-memory-usage, r=Veykril

    internal: Add missing queries to per_query_memory_usage
    bors committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    8ce5a53 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8593132 View commit details
    Browse the repository at this point in the history
  13. Auto merge of rust-lang#14306 - HKalbasi:master, r=HKalbasi

    fix block with no termination in or patterns
    
    fix rust-lang#14298
    bors committed Mar 9, 2023
    Configuration menu
    Copy the full SHA
    14b9d18 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2023

  1. Configuration menu
    Copy the full SHA
    116775b View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14311 - Veykril:lib-diags, r=Veykril

    internal: Don't attempt to calculate diagnostics in library crates
    
    We already filtered these later on, but we might as well stop calculating them alltogether. This way we also show cargo diagnostics that occur outside of the workspace which can happen when something goes very wrong (and which usually then causes no check diagnostics to appear in the workspace at all)
    bors committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    552aea5 View commit details
    Browse the repository at this point in the history
  3. Revert rust-lang#14285

    HKalbasi committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    71e1c02 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1b5bba4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0d19ccb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2cb6034 View commit details
    Browse the repository at this point in the history
  7. Fix is_quiescent reporting

    Veykril committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    c03775e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    070f8f8 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a980b56 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#14316 - HKalbasi:master, r=HKalbasi

    Fix stack overflow when derefrencing `&!`
    
    fix rust-lang#14310
    bors committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    9fca0a4 View commit details
    Browse the repository at this point in the history
  11. Use anonymous lifetimes

    iDawer committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    c38aa5f View commit details
    Browse the repository at this point in the history
  12. Remove unnecessary argument

    iDawer committed Mar 10, 2023
    Configuration menu
    Copy the full SHA
    8f189f6 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    5e8c586 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    17b9d35 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2023

  1. Fix overlap deduping infinite loop

    Fixes: 14276
    ComputerDruid committed Mar 11, 2023
    Configuration menu
    Copy the full SHA
    2691143 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14323 - ComputerDruid:fix_overlap_indexes, r=…

    …Veykril
    
    Fix overlap deduping infinite loop
    
    Fixes: rust-lang#14276
    bors committed Mar 11, 2023
    Configuration menu
    Copy the full SHA
    6d42e75 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#14326 - iDawer:refactor, r=Veykril

    internal: Rename `hir::diagnostics::MissingMatchArms.match_expr` field
    
    `hir::diagnostics::MissingMatchArms.match_expr` had confusing name: it is pointing to scrutinee expression. Renamed to `scrutinee_expr` and used better fitting type for it.
    
    Also small refactorings/cleanup.
    bors committed Mar 11, 2023
    Configuration menu
    Copy the full SHA
    70e10de View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cfc9d5c View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2023

  1. Configuration menu
    Copy the full SHA
    c3864eb View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14328 - lnicola:build-scripts-extra-args, r=V…

    …eykril
    
    fix: Pass flycheck extra args when running build scripts
    
    Closes rust-lang#14315
    
    Not sure if we want to do it like this or to add an extra config key, though.
    bors committed Mar 12, 2023
    Configuration menu
    Copy the full SHA
    f1e51af View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2023

  1. Configuration menu
    Copy the full SHA
    bdbd2a5 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#14333 - lnicola:sync-from-rust, r=lnicola

    minor: sync from downstream
    bors committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    9549753 View commit details
    Browse the repository at this point in the history
  3. ⬆️ rust-analyzer

    lnicola committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    e862901 View commit details
    Browse the repository at this point in the history