11065: internal: Don't kick off inference in `Semantics::descend_into_macros_impl` r=Veykril a=Veykril
We do not need inference info here so there is no point in calculating it
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
10484: internal: Update match checking algorithm r=lnicola a=iDawer
Sync match checking algorithm with rust-lang/rust f31622a50 2021-11-12 (https://github.com/rust-lang/rust/pull/90813)
This update brings huge simplification to the match checking and introduces an easy to use machinery for pattern destructuring and also:
1. Add a function to do post-inference normalization `hir_ty::infer::normalize(...)`.
2. Store binding modes in `InferenceResult`.
Todo:
- [x] Rebase & test (https://github.com/rust-analyzer/rust-analyzer/pull/10484#issuecomment-996669665)
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
11062: fix: Don't say "a reference to" for `Copy` types in the generate getter assist r=Veykril a=patrick-gu
This changes the generate getter assist to not say "a reference to" in the documentation stub if the type is `Copy`, as the getter does not return a reference.
To determine whether the type is `Copy`, I have added an `is_copy` method to `ReferenceConversion`.
Co-authored-by: patrick-gu <55641350+patrick-gu@users.noreply.github.com>
This changes the generate getter assist to not say "a reference to" in the documentation stub if the type is Copy, as the getter does not return a reference.
11043: fix: fix incorrect mismatched argument count diagnostic with `std::arch` functions r=jonas-schievink a=jonas-schievink
Adds basic support for `#[rustc_legacy_const_generics]`.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10009
Full support would involve actually checking call arguments against the right expected types.
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
11017: Support "move if to guard" with an else branch r=Veykril a=weirane
Support the assist `move_arm_cond_to_match_guard` when there is an else branch.
I have two questions:
1. How to indent the first line of a match arm? `matcharm.indent()` doesn't seem to work. so I hard coded four spaces here:
95a0de85d5/crates/ide_assists/src/handlers/move_guard.rs (L162-L163)
2. I find a little issue in the original implementation, this code
```rust
let y = match 92 {
x => {
if x == 0 {$0
false
}
}
_ => true,
};
```
will be transformed to
```rust
let y = match 92 {
x if x == 0 => false
_ => true,
};
```
a comma is missing after the `false`. Should I also fix that? Or this can go in a separate PR.
Closes#10997.
Co-authored-by: Wang Ruochen <wrc@ruo-chen.wang>