Conversation
The next commit will bring back `enum DepKind` and there would be a variant `DepKind::dep_kind`. This makes it impossible to have a variable named `dep_kind`, because the `bindings_with_variant_name` lint is overzealous. For this code: ``` let dep_kind = DepKind::dep_kind; ``` the lint will give this error: ``` pattern binding `dep_kind` is named the same as one of the variants of the type `DepKind` ``` This is arguably a bug in the lint. To work around it, this commit renames the `dep_kind` query as `crate_dep_kind`. It is a better name anyway given that `DepKind` and `CrateDepKind` are different things.
It was removed in rust-lang#115920 to enable it being moved to `rustc_query_system`, a move that has recently been reversed. It's much simpler as an enum. Also: - Remove the overly complicated `Debug` impl for `DepKind`. - Remove the trivial `DepKind` associated constants (`NULL` et al.) - Add an assertion to ensure that the number of `DepKinds` fits within a `u16`. - Rename `DEP_KIND_VARIANTS` as `DEP_KIND_NUM_VARIANTS`, to make it clearer that it's a count, not a collection. - Use `stringify!` in one place to make the code clearer.
There is a bunch of plumbing to record the string `"foo"` for each variant `DepKind::foo`. But that's what the `Debug `impl` now produces. So this commit removes the plumbing.
|
|
|
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Bring back `enum DepKind`.
|
Looks good, r=me after perf comes back. |
This comment has been minimized.
This comment has been minimized.
|
|
Finished benchmarking commit (11ae63e): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.7%, secondary 3.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.0%, secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 482.345s -> 482.424s (0.02%) |
|
☔ The latest upstream changes (presumably #152755) made this pull request unmergeable. Please resolve the merge conflicts. |
It was removed in #115920 to enable it being moved to
rustc_query_system, a move that has recently been reversed. It's much simpler as an enum.r? @Zalathar