1445: Use the new "durability" infrastructure from salsa r=matklad a=matklad
Based on https://github.com/nikomatsakis/salsa/tree/durability
Durability allows us to skip *validation* work for sysroot and crates.io libraries, which massively speeds up some workloads
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
1677: Associated types r=flodiebold a=flodiebold
This implements basic support for (fully qualified) associated type projections:
- handle fully qualified paths like `<T as Trait>::AssocType` (basically desugaring to something like `Trait<Self=T>::AssocType`)
- lower these to a new `Ty::Projection` enum variant
- also introduce `Ty::UnselectedProjection` for cases like `T::AssocType` where the trait from which the type comes isn't specified, but these aren't handled further so far
- in inference, normalize these projections using Chalk: basically, when encountering a type e.g. from a type annotation or signature, we replace these `Ty::Projection`s by type variables and add obligations to normalize the associated type
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
This adds three different representations, copied from the Chalk model:
- `Ty::Projection` is an associated type projection written somewhere in the
code, like `<Foo as Trait>::Bar`.
- `Ty::UnselectedProjection` is similar, but we don't know the trait
yet (`Foo::Bar`).
- The above representations are normalized to their actual types during type
inference. When that isn't possible, for example for `T::Item` inside an `fn
foo<T: Iterator>`, the type is normalized to an application type with
`TypeCtor::AssociatedType`.
1682: Drop support for old extendSelection API r=matklad a=matklad
Emacs now handles this via native LSP request
dc86bbb227
r? @flodiebold
(Have not actually tried elisp code)
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
1675: Improvements to emacs inlay hints r=matklad a=flodiebold
- only send request if workspace is initialized (emacs-lsp doesn't seem to
prevent sending requests before the initialized notification is sent)
- check whether we're still in the correct buffer before sending request
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
- only send request if workspace is initialized (emacs-lsp doesn't seem to
prevent sending requests before the initialized notification is sent)
- check whether we're still in the correct buffer before sending request
1668: Reduce code duplication in lexer r=matklad a=eupn
During an investigation of a fix for #1218, I stumbled upon some code duplication in the lexer.
Co-authored-by: Evgenii P <eupn@protonmail.com>
1661: Parse function parameters attributes r=matklad a=eupn
Fixes#1397. The [RFC-2565](https://github.com/rust-lang/rfcs/blob/master/text/2565-formal-function-parameter-attributes.md) specifies `#[attributes]` to function parameters:
```rust
fn foo(#[attr] a, #[unused] b, #[must_use] ...) {
// ...
}
```
This PR adds those attributes into grammar and to the parser, extending corresponding inline tests.
Co-authored-by: Evgenii P <eupn@protonmail.com>
1662: architecture.md: "finish not Y" -> "finish node Y" r=matklad a=eupn
Is this a typo?
Co-authored-by: eupn <36292692+eupn@users.noreply.github.com>