8321: Use exhaustive matches in shrink_to_fit impls r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8320: Make `ast_to_token_tree` infallible r=jonas-schievink a=jonas-schievink
It could never return `None`, so reflect that in the return type
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8319: Glob-reexport hir_def database types r=jonas-schievink a=jonas-schievink
Avoids having to constantly adjust this list
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8318: Use shrink_to_fit to reduce DefMap sizes r=jonas-schievink a=jonas-schievink
Especially `block_def_map` can overallocate when there's not a lot of items in the `DefMap`. This saves around 10 MB during analysis-stats. Not too much, but a cheap win.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8315: Try to reduce ItemTree size further r=jonas-schievink a=jonas-schievink
This was mostly a failed experiment, but still seems like the right thing to do. Memory reduction is mostly negligible.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
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>