This adds a "Convert Into to From" assist, useful since clippy has
recently started adding lints on every `Into`.
It covers converting the signature, and converting any `self`/`Self`
references within the body to the correct types.
It does assume that every instance of `Into` can be converted to a
`From`, which I _think_ is the case now. Let me know if there's
something I'm not thinking of and I can try and make it smarter.
8310: Rename Ty::interned to Ty::kind r=flodiebold a=flodiebold
... since that's the actual method on Chalk side that matches the signature.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
8309: Introduce `GenericArg` like in Chalk r=flodiebold a=flodiebold
Plus some more adaptations to Substitution.
Lots of `assert_ty_ref` that we should revisit when introducing lifetime/const parameters.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
8305: Fix joinLines panic if run on the empty last line r=edwin0cheng a=edwin0cheng
fixes#8299
bors r+
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
8304: Support the new `panic!()` macro r=jonas-schievink a=jonas-schievink
Includes a minor fixup to macro 2.0 parsing.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8303: Allow interning strings r=jonas-schievink a=jonas-schievink
We don't use it yet, that's a bit more complicated.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8298: Stop using an upgradeable read lock in interning r=jonas-schievink a=jonas-schievink
Only one upgradeable read lock can be handed out at the same time, and
we never acquire a non-upgradeable read lock, so this has no benefit
over just using a write lock in the first place.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Only one upgradeable read lock can be handed out at the same time, and
we never acquire a non-upgradeable read lock, so this has no benefit
over just using a write lock in the first place.
8284: Reduce memory usage by using global `Arc`-based interning r=jonas-schievink a=jonas-schievink
This saves around 50 mb when running `analysis-stats` on r-a itself. Not a lot, but this infra can be easily reused to intern more stuff.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8285: Don't recheck obligations if we have learned nothing new r=matklad a=flodiebold
This is just the most trivial check: If no inference variables have been updated, and there are no new obligations, we can just skip trying to solve them again. We could be smarter about it, but this already helps quite a bit, and I don't want to touch this too much before we replace the inference table by Chalk's.
Fixes#8263 (well, improves it quite a bit).
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
8283: Resolve associated types r=flodiebold a=Veykril
Prior we were only resolving paths until the first type was found, then discarding the result if the path wasn't fully consumed. That of course causes associated types to not resolve. Fixes#5003
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This is just the most trivial check: If no inference variables have been
updated, and there are no new obligations, we can just skip trying to
solve them again. We could be smarter about it, but this already helps
quite a bit, and I don't want to touch this too much before we replace
the inference table by Chalk's.
Fixes#8263 (well, improves it quite a bit).
8274: Adding a few more gifs and screenshots for features in manual r=Veykril a=MozarellaMan
Related #8267,#6539. Gifs are [here](https://github.com/rust-analyzer/rust-analyzer/issues/6539#issuecomment-809574840)
Finishing up the last PR, for the last two features that didn't have a visual example.
For syntax highlighting, I wasn't able to find a theme that displayed the difference between an enum and struct, but I only tried a few apart from the default so there could be one out there!
e.g., with the default light theme, `Ord` and `Ordering` in `use std::cmp::{Ord, Ordering}` had the same highlight colour. So I just went with displaying `mut` items being underlined.
Co-authored-by: Ayomide Bamidele <48062697+MozarellaMan@users.noreply.github.com>