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 11 pull requests #102926

Merged
merged 143 commits into from
Oct 11, 2022
Merged

Rollup of 11 pull requests #102926

merged 143 commits into from
Oct 11, 2022

Commits on Sep 9, 2022

  1. Configuration menu
    Copy the full SHA
    ba64c93 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aeeb9e0 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2022

  1. Configuration menu
    Copy the full SHA
    77c40f8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    447596c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4b5a66e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    997fc46 View commit details
    Browse the repository at this point in the history
  5. Removed unnecessary TODO

    OleStrohm committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    e28046c View commit details
    Browse the repository at this point in the history
  6. Cleaned up code

    OleStrohm committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    b63234e View commit details
    Browse the repository at this point in the history
  7. Almost there

    OleStrohm committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    2f84b6e View commit details
    Browse the repository at this point in the history
  8. Added consteval tests

    OleStrohm committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    ad0a6bf View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    301b889 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5313bd1 View commit details
    Browse the repository at this point in the history
  11. Rebased

    OleStrohm committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    177ec82 View commit details
    Browse the repository at this point in the history
  12. Fixed lints

    OleStrohm committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    3931e55 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2022

  1. Warn about safety of fetch_update

    Specifically as it relates to the ABA problem.
    Riolku committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    3d28a1a View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2022

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

Commits on Sep 19, 2022

  1. Configuration menu
    Copy the full SHA
    d9f5709 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13259 - Veykril:cargo-config-simplify, r=Veykril

    Simplify feature representation in CargoConfig
    bors committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    bc6d574 View commit details
    Browse the repository at this point in the history
  3. Simplify

    Veykril committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    a6c067c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4f2c86e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cdc362e View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#13262 - DidiBear:master, r=lnicola

    Remove reference to Toggle inlay hints
    
    This simply removes the reference to the `Toggle inlay hints` action after its removal in rust-lang/rust-analyzer#13215.
    In fact, this reference is still visible [in the User Manual here](https://rust-analyzer.github.io/manual.html#inlay-hints).
    bors committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    4d989b5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f87ad8d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9845e37 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#13264 - lowr:patch/no-dyn-without-trait, r=Ve…

    …ykril
    
    Ensure at least one trait bound in `TyKind::DynTy`
    
    One would expect `TyKind::DynTy` to have at least one trait bound, but we may produce a dyn type with no trait bounds at all. This patch prevents it by returning `TyKind::Error` in such cases.
    
    An "empty" dyn type would have caused panic during method resolution without rust-lang#13257. Although already fixed, I think an invariant to never produce such types would help prevent similar problems in the future.
    bors committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    bde76b9 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2022

  1. Simplify

    Veykril committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    7e8eac3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    027bfd6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    09600a3 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#12966 - OleStrohm:master, r=Veykril

    feat: Display the value of enum variant on hover
    
    fixes rust-lang#12955
    
    This PR adds const eval support for enums, as well as showing their value on hover, just as consts currently have.
    
    I developed these two things at the same time, but I've realized now that they are separate. However since the hover is just a 10 line change (not including tests), I figured I may as well put them in the same PR. Though if you want them split up into "enum const eval support"  and "show enum variant value on hover", I think that's reasonable too.
    
    Since this adds const eval support for enums this also allows consts that reference enums to have their values computed now too.
    
    The const evaluation itself is quite rudimentary, it doesn't keep track of the actual type of the enum, but it turns out that Rust doesn't actually either, and `E::A as u8` is valid regardless of the `repr` on `E`.
    
    It also doesn't really care about what expression the enum variant contains, it could for example be a string, despite that not being allowed, but I guess it's up to the `cargo check` diagnostics to inform of such issues anyway?
    bors committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    817a6a8 View commit details
    Browse the repository at this point in the history
  5. Simplify

    Veykril committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    6d0d051 View commit details
    Browse the repository at this point in the history
  6. Parse more repr options

    Veykril committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    9f233cd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b25f0ba View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2119c1f View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9bf386f View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#13269 - Veykril:repr, r=Veykril

    Properly set the enum variant body type from the repr attribute
    
    Follow up for rust-lang/rust-analyzer#12966, fixes some type inference problems
    bors committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    5b49745 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2022

  1. Configuration menu
    Copy the full SHA
    c2dc32c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9ede5f0 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2022

  1. Configuration menu
    Copy the full SHA
    40e8f03 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    729a9eb View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2022

  1. Configuration menu
    Copy the full SHA
    fb0ce25 View commit details
    Browse the repository at this point in the history
  2. Don't run proc-macro-srv tests on the rust-analyzer repo

    proc-macro ABI breakage still affects the tests when a new stable version
    releases. Ideally we'd still be able to run the tests on the rust-analyzer
    repo without having to update the proc-macro ABI, but for now just to
    unblock CI we will ignore them here, as they are still run in upstream.
    Veykril committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    f57cd83 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#13286 - Veykril:proc-macro-srv-tests, r=Veykril

    Don't run proc-macro-srv tests on the rust-analyzer repo
    
    proc-macro ABI breakage still affects the tests when a new stable version releases. Ideally we'd still be able to run the tests on the rust-analyzer repo without having to update the proc-macro ABI, but for now just to unblock CI we will ignore them here, as they are still run in upstream.
    bors committed Sep 23, 2022
    Configuration menu
    Copy the full SHA
    1440078 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2022

  1. Configuration menu
    Copy the full SHA
    7ec9ffa View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13285 - Veykril:variant-body, r=Veykril

    Properly support IDE functionality in enum variants
    bors committed Sep 24, 2022
    Configuration menu
    Copy the full SHA
    4e7bb5e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0231d19 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#13288 - Veykril:variant-body, r=Veykril

    Fix diagnostics not working in enum variant bodies
    
    cc rust-lang/rust-analyzer#12966
    bors committed Sep 24, 2022
    Configuration menu
    Copy the full SHA
    fa38c10 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    73f6af5 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#13289 - rust-lang:analysis-stats-proc-server,…

    … r=Veykril
    
    Use the sysroot proc-macro server for analysis-stats
    
    Should fix the metrics issues
    bors committed Sep 24, 2022
    Configuration menu
    Copy the full SHA
    73ab709 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2022

  1. Configuration menu
    Copy the full SHA
    2ea770d View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13209 - lowr:feat/inference-for-generator, r=…

    …Veykril
    
    feat: type inference for generators
    
    This PR implements basic type inference for generator and yield expressions.
    
    Things not included in this PR:
    - Generator upvars and generator witnesses are not implemented. They are only used to determine auto trait impls, so basic type inference should be fine without them, but method resolutions with auto trait bounds may not be resolved correctly.
    
    Open questions:
    - I haven't (yet) implemented `HirDisplay` for `TyKind::Generator`, so generator types are just shown as "{{generator}}" (in tests, inlay hints, hovers, etc.), which is not really nice. How should we show them?
    - I added moderate amount of stuffs to minicore. I especially didn't want to add `impl<T> Deref for &T` and `impl<T> Deref for &mut T` exclusively for tests for generators; should I move them into the test fixtures or can they be placed in minicore?
    
    cc rust-lang#4309
    bors committed Sep 26, 2022
    Configuration menu
    Copy the full SHA
    1f92965 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7929e9c View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#13248 - harudagondi:unwrap-tuple, r=Veykril

    Feature: Add assist to unwrap tuple declarations
    
    > Implement rust-lang#12923 for only tuples.
    >
    > Does not implement unwrapping for structs, as mentioned in the issue.
    
    Add assist to unwrap tuples declarations to separate declarations.
    
    ```rust
    fn main() {
    	$0let (foo, bar, baz) = (1.0, "example", String::new())
    }
    ```
    
    becomes:
    
    ```rust
    fn main() {
    	let foo = 1.0;
    	let bar = "example";
    	let baz = String::new();
    }
    ```
    
    ## Changelog
    
    ### Feature
    
    - Added assist to unwrap tuple declarations.
    bors committed Sep 26, 2022
    Configuration menu
    Copy the full SHA
    1a24003 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    aa093f5 View commit details
    Browse the repository at this point in the history
  6. fix model tests

    Strum355 committed Sep 26, 2022
    Configuration menu
    Copy the full SHA
    60b432b View commit details
    Browse the repository at this point in the history
  7. formatting

    Strum355 committed Sep 26, 2022
    Configuration menu
    Copy the full SHA
    651c586 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    89107d5 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b21bf25 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3a8d84b View commit details
    Browse the repository at this point in the history
  11. Generate From impls manually

    unexge committed Sep 26, 2022
    Configuration menu
    Copy the full SHA
    7e5e517 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2022

  1. Auto merge of rust-lang#13275 - Veykril:find-path, r=Veykril

    Fix find_path using the wrong module for visibility calculations
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    8c7e376 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13295 - rust-lang:sourcegen, r=Veykril

    Remove obsolete in-rust-tree feature from sourcegen
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    f972cdd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fb73644 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#13189 - unexge:unconfigured-diagnostics-for-f…

    …ields, r=Veykril
    
    Emit unconfigured code diagnostics for enum variants and struct/union fields
    
    Fixes rust-lang/rust-analyzer#12664
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    b01cdd8 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#13296 - Strum355:package-information-package-…

    …name, r=Veykril
    
    Fix PackageInformation having the crate name instead of package name
    
    The `PackageInformation` type from the LSIF PR used the _crate_ name instead of the _package_ name. This caused issues when looking up crates by this name on the Sourcegraph backend, where we sync crate contents, for crates such as actix-web and many of its components (actix-files, actix-http etc etc), see screenshot 1 for the observed symptom.
    
    This PR hasnt been tested on other entry points besides cargo (such as project json).
    
    See screenshot 2 for the change in behaviour via SCIP snapshot comparison.
    
    <details>
    <summary>Screenshot 1</summary>
    
    ![crates.io giving 404](https://user-images.githubusercontent.com/18282288/192286637-8bf7c333-4441-4e60-8cce-de7eaa11ee9f.png)
    
    </details>
    
    <details>
    <summary>Screenshot 2</summary>
    
    ![before and after from SCIP snapshot output](https://user-images.githubusercontent.com/18282288/192287733-d7e73ff0-abbc-4ae5-82d0-bf9dc45d755c.png)
    
    </details>
    
    Follow-up PR to my question over at the [rust-lang Zulip](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/canonical.20crate.20name.20confusion.20for.20monikers), excuse any incorrect usages of the term package vs crate.
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    8805d05 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#13300 - Veykril:cfg-false, r=Veykril

    Use cfg(any()) instead of cfg(FALSE) for disabling proc-macro test
    
    cc rust-lang/rust-analyzer#13286
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    bd8c5b6 View commit details
    Browse the repository at this point in the history
  7. Amalgamate file changes for the same file ids in process_changes

    When receiving multiple change events for a single file id where the
    last change is a delete the server panics, as it tries to access the
    file contents of a deleted file. This occurs due to the VFS changes and
    the in memory file contents being updated immediately, while
    `process_changes` processes the events afterwards in sequence which no
    longer works as it will only observe the final file contents. By
    folding these events together, we will no longer try to process these
    intermediate changes, as they aren't relevant anyways.
    
    Potentially fixes rust-lang/rust-analyzer#13236
    Veykril committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    c3a6c96 View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#13237 - Veykril:process-changes, r=Veykril

    Amalgamate file changes for the same file ids in process_changes
    
    When receiving multiple change events for a single file id where the last change is a delete the server panics, as it tries to access the file contents of a deleted file. This occurs due to the VFS changes and the in memory file contents being updated immediately, while `process_changes` processes the events afterwards in sequence which no longer works as it will only observe the final file contents. By folding these events together, we will no longer try to process these intermediate changes, as they aren't relevant anyways.
    
    Potentially fixes rust-lang/rust-analyzer#13236
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    093de32 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#13280 - alanz:errorcode-requestfailed, r=Veykril

    Add RequestFailed error code, as per spec 3.17
    
    See microsoft/language-server-protocol#1341
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    03aa704 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#13272 - oknozor:master, r=Veykril

    docs(guide): fix Analysis and AnalysisHost doc links
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    b16b041 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1a6c159 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#13202 - Veykril:cancelled-retry, r=Veykril

    Don't retry requests that have already been cancelled
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    9ba55ba View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f5fe6b1 View commit details
    Browse the repository at this point in the history
  14. Auto merge of rust-lang#13301 - Veykril:empty-assist-source-changes, …

    …r=Veykril
    
    Make assist tests panic again on empty source changes
    bors committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    ad752bd View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2022

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

Commits on Sep 29, 2022

  1. Configuration menu
    Copy the full SHA
    6d8903a View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13311 - lowr:fix/for-loop-item-resolution, r=…

    …Veykril
    
    fix: infer for-loop item type with `IntoIterator` and `Iterator`
    
    Part of rust-lang#13299
    
    We've been inferring the type of the yielded values in for-loop as `<T as IntoIterator>::Item`. We infer the correct type most of the time when we normalize the projection type, but it turns out not always. We should infer the type as `<<T as IntoIterator>::IntoIter as Iterator>::Item`.
    
    When one specifies `IntoIter` assoc type of `IntoIterator` but not `Item` in generic bounds, we fail to normalize `<T as IntoIterator>::Item` (even though `IntoIter` is defined like so: `type IntoIter: Iterator<Item = Self::Item>` - rustc does *not* normalize projections based on other projection's bound I believe; see [this playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e88e19385094cb98fadbf647b4c2082e)).
    
    Note that this doesn't fully fix # 13299 - given the following code, chalk can normalize `<I as IntoIterator>::IntoIter` to `S`, but cannot normalize `<S as Iterator>::Item` to `i32`.
    
    ```rust
    struct S;
    impl Iterator for S { type Item = i32; /* ... */ }
    fn f<I: IntoIterator<IntoIter = S>>(it: I) {
        for elem in it {}
          //^^^^{unknown}
    }
    ```
    
    This is because chalk finds multiple answers that satisfy the query `AliasEq(<S as Iterator>::Item = ?X`: `?X = i32` and `?X = <I as IntoIterator>::Item` - which are supposed to be the same type due to the aforementioned bound on `IntoIter` but chalk is unable to figure it out.
    bors committed Sep 29, 2022
    Configuration menu
    Copy the full SHA
    97f8f4a View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2022

  1. Stabilize map_first_last

    est31 committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    2c72ea7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8c433c7 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#13319 - Veykril:req-retry, r=Veykril

    Fix requests not being retried anymore
    bors committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    8132b42 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3cd57c4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    77cfc9b View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#13320 - Veykril:ty-alias-hover, r=Veykril

    Fix type alias hovers not rendering generic parameters
    bors committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    17363b3 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#13318 - Veykril:annotations, r=Veykril

    Fix annotations not resolving when lens location is set to whole item
    
    Fixes rust-lang/rust-analyzer#13310
    bors committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    2293949 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3ad0334 View commit details
    Browse the repository at this point in the history
  9. Auto merge of rust-lang#13321 - Veykril:format-str-args, r=Veykril

    Fix move_format_string_arg being tokentree unaware
    
    Fixes rust-lang/rust-analyzer#13261
    bors committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    5b7e400 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2022

  1. Configuration menu
    Copy the full SHA
    bfd5f00 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13324 - Veykril:trait-impl-completion, r=Veykril

    Fix trait impl item completions using macro file text ranges
    
    Fixes rust-lang/rust-analyzer#13323
    bors committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    f88293f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    26cf250 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#13326 - Veykril:proc-macro-srv-config, r=Veykril

    Do not use the sysroot proc-macro server when a server path is given explicitly
    bors committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    bf5cad8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5424c51 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#13327 - Veykril:proc-macro-srv-config, r=Veykril

    Add config for supplying sysroot path
    bors committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    cdc5493 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    870825b View commit details
    Browse the repository at this point in the history
  8. Auto merge of rust-lang#13328 - Veykril:rustc-proc-macro, r=Veykril

    Add proc-macro dependency to rustc crates
    bors committed Oct 1, 2022
    Configuration menu
    Copy the full SHA
    5c28ad1 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2022

  1. Configuration menu
    Copy the full SHA
    f8f5a5e View commit details
    Browse the repository at this point in the history
  2. Change generic parameter/argument order

    This commit "inverts" the order of generic parameters/arguments of an
    item and its parent. This is to fulfill chalk's expectation on the
    order of `Substitution` for generic associated types and it's one step
    forward for their support (hopefully).
    
    Although chalk doesn't put any constraint on the order of `Substitution`
    for other items, it feels natural to get everything aligned rather than
    special casing GATs.
    
    One complication is that `TyBuilder` now demands its users to pass in
    parent's `Substitution` upon construction unless it's obvious that the
    the item has no parent (e.g. an ADT never has parent). All users
    *should* already know the parent of the item in question, and without
    this, it cannot be easily reasoned about whether we're pushing the
    argument for the item or for its parent.
    
    Quick comparison of how this commit changes `Substitution`:
    
    ```rust
    trait Trait<TP, const CP: usize> {
      type Type<TC, const CC: usize> = ();
      fn f<TC, const CC: usize>() {}
    }
    ```
    
    - before this commit: `[Self, TP, CP, TC, CC]` for each trait item
    - after this commit: `[TC, CC, Self, TP, CP]` for each trait item
    lowr committed Oct 2, 2022
    Configuration menu
    Copy the full SHA
    4385d3d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    78977cd View commit details
    Browse the repository at this point in the history
  4. Remove hack

    lowr committed Oct 2, 2022
    Configuration menu
    Copy the full SHA
    7556f74 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2022

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

    Prioritize restart messages in flycheck
    
    cc rust-lang/rust-analyzer#12936 (comment)
    bors committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    f087ebe View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#13335 - lowr:patch/change-generic-param-order…

    …, r=Veykril
    
    internal: change generic parameter order
    
    tl;dr: This PR changes the `Substitution` for trait items and methods like so:
    
    ```rust
    trait Trait<TP, const CP: usize> { // note the implicit Self as first parameter
      type Type<TC, const CC: usize>;
      fn f<TC, const CC: usize>() {}
    }
    impl<TP, const CP: usize> S {
      fn f<TC, const CC: usize>() {}
    }
    ```
    
    - before this PR: `[Self, TP, CP, TC, CC]` for each trait item, `[TP, CP, TC, CC]` for `S::f`
    - after this PR: `[TC, CC, Self, TP, CP]` for each trait item, `[TC, CC, TP, CP]` for `S::f`
    
    ---
    
    This PR "inverts" the generic parameters/arguments of an item and its parent. This is to fulfill [chalk's expectation](https://github.com/rust-lang/chalk/blob/d875af0ff196dd6430b5f5fd87a640fa5ab59d1e/chalk-solve/src/rust_ir.rs#L498-L502) on the order of generic arguments in `Substitution`s for generic associated types and it's one step forward for GATs support (hopefully). Although chalk doesn't put any constraint for other items, it feels more natural to get everything aligned than special casing GATs.
    
    One complication is that `TyBuilder` now demands its users to pass in parent's `Substitution` upon construction unless it's obvious that the the item has no parent (e.g. an ADT never has parent). All users *should* already know the parent of the item in question, and without this, it cannot be easily reasoned about whether we're pushing the argument for the item or for its parent.
    
    Some additional notes:
    - f8f5a5e: This isn't related to the change, but I felt it's nicer.
    
    - 78977cd: There's one major change here other than the generic param order: Default arguments are now bound by the same `Binder` as the item in question rather than a `Binder` limited to parameters they can refer to (i.e. arguments that syntactically appear before them). Now that the order of generic parameters is changed, it would be somewhat complicated to make such `Binder`s as before, and the "full" `Binder`s shouldn't be a problem because we already make sure that the default arguments don't refer to the generic arguments after them with `fallback_bound_vars()`.
    
    - 7556f74: This is split from 4385d3d to make it easy to revert if it turns out that the GATs with const generics panic is actually not resolved with this PR. cc rust-lang#11878 rust-lang#11957
    bors committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    5bd98e3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e0a161b View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#13339 - lowr:patch/change-generic-param-order…

    …, r=Veykril
    
    fix: treat enum variants as generic item on their own
    
    Fixup for rust-lang#13335
    
    It turns out I tried to merge two procedures into one utility function without noticing the incompatibility.
    
    This time I *did* run analysis-stats on the four crates and confirmed it doesn't crash and this patch doesn't cause regression.
    bors committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    974caaf View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2022

  1. Configuration menu
    Copy the full SHA
    e0c9e28 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13342 - rust-lang:revert-13328-rustc-proc-mac…

    …ro, r=Veykril
    
    Revert "Add proc-macro dependency to rustc crates"
    
    1. This panics since it indexes into the wrong thing, so fixes rust-lang/rust-analyzer#13340
    2. This didn't fix what I thought it would either
    Reverts rust-lang/rust-analyzer#13328
    bors committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    b429df2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ded3326 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#13344 - lowr:patch/change-generic-param-order…

    …, r=Veykril
    
    fix: use `BoundVar`s from current generic scope
    
    Fixup for rust-lang#13335, addresses rust-lang/rust-analyzer#13339 (comment)
    
    Before the change in generic parameter order, `BoundVar`s for trait reference didn't change whether you are in an impl's scope or in an associated item's scope. Now that item's generic params come before its parent's, we need to shift their indices when we are in an associated item's scope.
    bors committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    476d043 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2022

  1. Interpret EH actions properly

    The EH actions stored in the LSDA follows the format of GCC except table
    (even for LLVM-generated code). An missing action in the table is the
    encoding for `Terminate`, see [1].
    
    The currently code interprets it as `None`, as a workaround for rust-lang#35011,
    an issue that seems to occur in LLVM 3.7 and not after 3.9. These are
    very old versions of LLVM and we don't support them anymore, so remove
    this workaround and interpret them properly.
    
    Note that LLVM currently does not emit any `Terminate` actions, but GCC
    does. Although GCC backend currently doesn't do unwinding, removing it
    preemptively would prevent future developers from wasting time to figure
    out what's wrong.
    
    [1]: https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/eh_personality.cc#L522-L526
    nbdd0121 committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    8bda133 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8862fe6 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2022

  1. Configuration menu
    Copy the full SHA
    a57ef6b View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13356 - WaffleLapkin:go_to_def_shadow_include…

    …, r=Veykril
    
    minor: Fix go-to-def for shadowed `include*!`
    
    Add a check in go-to-def feature, so that we don't assume any macro named `include`/`include_str`/`include_bytes` is the builtin one.
    bors committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    f2f3528 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#13353 - wildbook:fix_type_inference_panic, r=…

    …Veykril
    
    Fix assertion failure in type inference (rust-lang#13352)
    
    Fixes rust-lang/rust-analyzer#13352
    bors committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    a415fb4 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2022

  1. Configuration menu
    Copy the full SHA
    1c0ec9f View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13362 - WaffleLapkin:go_to_def_fix_doc_includ…

    …e_str, r=Veykril
    
    fix: Make go-to-def work for `#[doc = include_str!("path")]`
    
    See the added test, go-to-def on `#[doc = include_str!("path$0")]` should navigate to `path`.
    bors committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    8437e4b View commit details
    Browse the repository at this point in the history
  3. ADD - codegen_ssa initial diags translations machinery

    ADD - migrate MissingNativeStaticLibrary fatal error
    JhonnyBillM committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    b0b072d View commit details
    Browse the repository at this point in the history
  4. ADD - migrate lib.def write fatal error

    This diagnostic has no UI test 🤔 Should we add some? If so, how?
    JhonnyBillM committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    4e0de53 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0a2d7f8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    086e70f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d9197db View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    67eb01c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7548d95 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0f97d4a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    12aa84b View commit details
    Browse the repository at this point in the history
  12. Address PR comments

    - UPDATE - revert migration of logs
    
    - UPDATE - use derive on LinkRlibError enum
    
    - [Gardening] UPDATE - alphabetically sort fluent_messages
    
    - UPDATE - use PathBuf and unify both AddNativeLibrary to use Display (which is what PathBuf uses when conforming to IntoDiagnosticArg)
    
    - UPDATE - fluent messages sort after rebase
    JhonnyBillM committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    a25f939 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    13d4f27 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2022

  1. internal: ⬆️ xflags

    The main change here should be that flags are not inhereted, so
    
       $ rust-analyzer analysis-stats . -v -v
    
    would do what it should do
    
    We also no longer Don\'t
    matklad committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    39fa8b5 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#13366 - matklad:xflags, r=lnicola

    internal: ⬆️ xflags
    
    The main change here should be that flags are not inhereted, so
    
       $ rust-analyzer analysis-stats . -v -v
    
    would do what it should do
    
    We also no longer Don\'t
    bors committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    61504c8 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2022

  1. Configuration menu
    Copy the full SHA
    61519b8 View commit details
    Browse the repository at this point in the history
  2. fix rust-lang#102878

    TaKO8Ki committed Oct 10, 2022
    Configuration menu
    Copy the full SHA
    6826028 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2022

  1. Do not alias for fs

    azdavis committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    d1762d7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a8f177 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    152cd63 View commit details
    Browse the repository at this point in the history
  4. ⬆️ rust-analyzer

    lnicola committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    c867288 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#100387 - cjgillot:hygiene-trait-impl, r=pet…

    …rochenkov
    
    Check uniqueness of impl items by trait item when applicable.
    
    When checking uniqueness of item names in impl blocks, we currently use the same definition of hygiene as for toplevel items.  This means that a plain item and one generated by a macro 2.0 do not collide.
    
    This hygiene rule does not match with how impl items resolve to associated trait items. As a consequence, we misdiagnose the trait impls.
    
    This PR proposes to consider that trait impl items are uses of the corresponding trait items during resolution, instead of checking for duplicates later. An error is emitted when a trait impl item is used twice.
    
    There should be no stable breakage, since macros 2.0 are still unstable.
    
    r? ``@petrochenkov``
    cc ``@RalfJung``
    
    Fixes rust-lang#71614.
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    6d58ff7 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#101727 - est31:stabilize_map_first_last, r=…

    …m-ou-se
    
    Stabilize map_first_last
    
    Stabilizes the following functions:
    
    ```Rust
    impl<T> BTreeSet<T> {
        pub fn first(&self) -> Option<&T> where T: Ord;
        pub fn last(&self) -> Option<&T> where T: Ord;
        pub fn pop_first(&mut self) -> Option<T> where T: Ord;
        pub fn pop_last(&mut self) -> Option<T> where T: Ord;
    }
    
    impl<K, V> BTreeMap<K, V> {
        pub fn first_key_value(&self) -> Option<(&K, &V)> where K: Ord;
        pub fn last_key_value(&self) -> Option<(&K, &V)> where K: Ord;
        pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord;
        pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord;
        pub fn pop_first(&mut self) -> Option<(K, V)> where K: Ord;
        pub fn pop_last(&mut self) -> Option<(K, V)> where K: Ord;
    }
    ```
    
    Closes rust-lang#62924
    
    ~~Blocked on the [FCP](rust-lang#62924 (comment)) finishing.~~ Edit: It finished!
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    cadb37a View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#101774 - Riolku:atomic-update-aba, r=m-ou-se

    Warn about safety of `fetch_update`
    
    Specifically as it relates to the ABA problem.
    
    `fetch_update` is a useful function, and one that isn't provided by, say, C++. However, this does not mean the function is magic. It is implemented in terms of `compare_exchange_weak`, and in particular, suffers from the ABA problem. See the following code, which is a naive implementation of `pop` in a lock-free queue:
    
    ```rust
    fn pop(&self) -> Option<i32> {
        self.front.fetch_update(Ordering::Relaxed, Ordering::Acquire, |front| {
            if front == ptr::null_mut() {
                None
            }
            else {
                Some(unsafe { (*front).next })
            }
        }.ok()
    }
    ```
    
    This code is unsound if called from multiple threads because of the ABA problem. Specifically, suppose nodes are allocated with `Box`. Suppose the following sequence happens:
    
    ```
    Initial: Queue is X -> Y.
    
    Thread A: Starts popping, is pre-empted.
    Thread B: Pops successfully, twice, leaving the queue empty.
    Thread C: Pushes, and `Box` returns X (very common for allocators)
    Thread A: Wakes up, sees the head is still X, and stores Y as the new head.
    ```
    
    But `Y` is deallocated. This is undefined behaviour.
    
    Adding a note about this problem to `fetch_update` should hopefully prevent users from being misled, and also, a link to this common problem is, in my opinion, an improvement to our docs on atomics.
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    d13f7ae View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#102227 - devnexen:solarish_get_path, r=m-ou-se

    fs::get_path solarish version.
    
    similar to linux, albeit there is no /proc/self notion on solaris
     based system thus flattening the difference for simplification sake.
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    51320b3 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#102445 - jmillikin:cstr-is-empty, r=Mark-Si…

    …mulacrum
    
    Add `is_empty()` method to `core::ffi::CStr`.
    
    ACP: rust-lang/libs-team#106
    
    Tracking issue: rust-lang#102444
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    d10b47e View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#102612 - JhonnyBillM:migrate-codegen-ssa-to…

    …-diagnostics-structs, r=davidtwco
    
    Migrate `codegen_ssa` to diagnostics structs - [Part 1]
    
    Initial migration of `codegen_ssa`. Going to split this crate migration in at least two PRs in order to avoid a huge PR and to quick off some questions around:
    
    1. Translating messages from "external" crates.
    2. Interfacing with OS messages.
    3. Adding UI tests while migrating diagnostics.
    
    _See comments below._
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    24722e8 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#102685 - nbdd0121:unwind, r=m-ou-se

    Interpret EH actions properly
    
    The EH actions stored in the LSDA follows the format of GCC except table (even for LLVM-generated code). An missing action in the table is the encoding for `Terminate`, see https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/eh_personality.cc#L522-L526.
    
    The currently code interprets it as `None`, as a workaround for rust-lang#35011, an issue that seems to occur in LLVM 3.7 and not after 3.9. These are very old versions of LLVM and we don't support them anymore, so remove this workaround and interpret them properly.
    
    Note that LLVM currently does not emit any `Terminate` actions, but GCC does. Although GCC backend currently doesn't do unwinding, removing it preemptively would prevent future developers from wasting time to figure out what's wrong.
    
    ``@rustbot`` label: +T-compiler
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    1b1223d View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#102869 - azdavis:master, r=joshtriplett

    Add basename and dirname aliases
    
    Users might be used to the POSIX names of these functions. In fact, here's a [blog post][1] about this very thing.
    
    [1]: https://boinkor.net/2019/07/basename-and-dirname-in-rust/
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    ccde95f View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#102889 - petrochenkov:partres, r=cjgillot

    rustc_hir: Less error-prone methods for accessing `PartialRes` resolution
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    cb67283 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a13c7da View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#102912 - lnicola:rust-analyzer-2022-10-11, …

    …r=lnicola
    
    ⬆️ rust-analyzer
    
    r? `@ghost`
    matthiaskrgr authored Oct 11, 2022
    Configuration menu
    Copy the full SHA
    3e01d07 View commit details
    Browse the repository at this point in the history