rust/crates
bors[bot] 11326a6847
Merge #10387
10387: Move `IdxRange` into la-arena r=Veykril a=arzg

Currently, `IdxRange` (named `IdRange`) is located in `hir_def::item_tree`, when really it isn’t specific to `hir_def` and could become part of la-arena. The rename from `IdRange` to `IdxRange` is to maintain consistency with the naming convention used throughout la-arena (`Idx` instead of `Id`, `RawIdx` instead of `RawId`). This PR also adds a few new APIs to la-arena on top of `IdxRange` for convenience, namely:

- indexing into an `Arena` by an `IdxRange` and getting a slice of values back
- creating an `IdxRange` from an inclusive range

Currently this PR also exposes a new `Arena::next_idx` method to make constructing inclusive`IdxRange`s using `IdxRange::new` easier; however, it would in my opinion be better to remove this as it allows for easy creation of out-of-bounds `Idx`s, when `IdxRange::new_inclusive` mostly covers the same use-case while being less error-prone.

I decided to bump the la-arena version to 0.3.0 from 0.2.0 because adding a new `Index` impl for `Arena` turned out to be a breaking change: I had to add a type hint in `crates/hir_def/src/body/scope.rs` when one wasn’t necessary before, since rustc couldn’t work out the type of a closure parameter now that there are multiple `Index` impls. I’m not sure whether this is the right decision, though. 

Co-authored-by: Aramis Razzaghipour <aramisnoah@gmail.com>
2021-10-20 20:54:36 +00:00
..
base_db Fix standard library doclinks not going to the correct page 2021-10-20 16:36:01 +02:00
cfg a few clippy fixes 2021-10-14 19:57:21 +01:00
flycheck a few clippy fixes 2021-10-14 19:57:21 +01:00
hir Resolve derive attributes even when shadowed 2021-10-19 13:42:36 +02:00
hir_def Merge #10387 2021-10-20 20:54:36 +00:00
hir_expand Merge #10387 2021-10-20 20:54:36 +00:00
hir_ty Merge #10387 2021-10-20 20:54:36 +00:00
ide Fix standard library doclinks not going to the correct page 2021-10-20 16:36:01 +02:00
ide_assists Fix: remove extra newline 2021-10-19 23:46:43 +09:00
ide_completion Fix qualified lint completions ignoring the qualifier value 2021-10-20 14:03:41 +02:00
ide_db Generate rustdoc lints 2021-10-20 13:48:05 +02:00
ide_diagnostics Fix missing_fields diagnostic fix replacing wrong text ranges 2021-10-15 19:27:19 +02:00
ide_ssr
limit
mbe internal: clean up code duplication 2021-10-10 21:08:10 +03:00
parser internal: Parse const trait bounds 2021-10-19 14:20:00 +02:00
paths
proc_macro_api
proc_macro_srv
proc_macro_test
profile Move IdxRange into la_arena 2021-10-15 13:03:28 +11:00
project_model Merge #10387 2021-10-20 20:54:36 +00:00
rust-analyzer Fix tests 2021-10-18 12:03:49 +03:00
sourcegen
stdx Kill the child process before waiting in streaming_output 2021-10-14 13:53:25 +02:00
syntax internal: Parse const trait bounds 2021-10-19 14:20:00 +02:00
test_utils Derive completions work on hir, not names 2021-10-19 13:50:08 +02:00
text_edit
toolchain
tt
vfs Merge #10423 2021-10-12 18:35:03 +00:00
vfs-notify