3275: Add Structural Search and Replace doc r=matklad a=adamrk
Addresses the first point of https://github.com/rust-analyzer/rust-analyzer/issues/3186.
Co-authored-by: adamrk <ark.email@gmail.com>
Co-authored-by: Adam Bratschi-Kaye <ark.email@gmail.com>
3276: Bump crossbeam crates r=kjeremy a=lnicola
This removes a duplicate `autocfg` dependency and was supposed to upgrade `rand`, but it got reverted in `crossbeam` to keep it compiling on pre-2018 edition compilers.
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3263: Implement unsizing coercions using Chalk r=matklad a=flodiebold
These are coercions like `&[T; n] -> &[T]`, which are handled by the `Unsize` and `CoerceUnsized` traits. The impls for `Unsize` are all built in to the compiler and require special handling, so we need to provide them to Chalk.
This adds the following `Unsize` impls:
- `Unsize<[T]> for [T; _]`
- `Unsize<dyn Trait> for T where T: Trait`
- `Unsize<dyn SuperTrait> for dyn SubTrait`
Hence we are still missing the 'unsizing the last field of a generic struct' case.
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3260: Refactor how builtins are resolved r=matklad a=flodiebold
This fixes autocompletion suggesting e.g. `self::usize`. (I thought we had a bug for that, but I didn't find it.)
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
3262: Fix handling of const patterns r=matklad a=flodiebold
E.g. in `match x { None => ... }`, `None` is a path pattern (resolving to the
option variant), not a binding. To determine this, we need to try to resolve the
name during lowering. This isn't too hard since we already need to resolve names
for macro expansion anyway (though maybe a bit hacky).
Fixes#1618.
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
3244: Rename module references r=matklad a=adamrk
Rename references to a module when the module is renamed. This fixes some missing renames in the existing implementation. For example, renaming the module `foo` to `foo2` in this case:
```rust
mod foo {
pub fn bar() {}
}
fn main() {
foo::bar()
}
```
previously would not change the call `foo::bar()` to `foo2::bar()`, but now it will.
Co-authored-by: adamrk <ark.email@gmail.com>
Co-authored-by: Adam Bratschi-Kaye <ark.email@gmail.com>
3264: Tidy up documentation. r=flodiebold a=ablakey
Thought I'd tidy up the docs while reading through them. Hope you don't mind!
For the most part, I just made the formatting consistent through-out and added a few words here and there. Also updated the language server install graphic.
Co-authored-by: Andrew Blakey <ablakey@locusrobotics.com>
E.g. in `match x { None => ... }`, `None` is a path pattern (resolving to the
option variant), not a binding. To determine this, we need to try to resolve the
name during lowering. This isn't too hard since we already need to resolve names
for macro expansion anyway (though maybe a bit hacky).
Fixes#1618.