Use field ident spans directly instead of the full field span in diagnostics on local fields#127431
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 8, 2024
Merged
Conversation
…nostics on local fields
Collaborator
|
rustbot has assigned @michaelwoerister. Use |
oli-obk
commented
Jul 6, 2024
| match def_id.as_local() { | ||
| Some(def_id) => self.field_def_ids.get(&def_id).copied(), | ||
| None => Some(self.tcx.associated_item_def_ids(def_id)), | ||
| Some(def_id) => self.field_names.get(&def_id).cloned(), |
Contributor
Author
There was a problem hiding this comment.
Instead of invoking queries at all the field_def_ids call sites, we now have a single clone here. This only ever happens in diagnostics code paths, so it's not perf critical anyway.
compiler-errors
approved these changes
Jul 7, 2024
Contributor
|
@bors r+ |
Collaborator
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
Jul 8, 2024
…r-errors Use field ident spans directly instead of the full field span in diagnostics on local fields This improves diagnostics and avoids having to store the `DefId`s of fields
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 8, 2024
Rollup of 12 pull requests Successful merges: - rust-lang#113128 (Support tail calls in mir via `TerminatorKind::TailCall`) - rust-lang#126841 ([`macro_metavar_expr_concat`] Add support for literals) - rust-lang#126881 (Make `NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE` a deny-by-default lint in edition 2024) - rust-lang#126921 (Give VaList its own home) - rust-lang#127276 (rustdoc: Remove OpaqueTy) - rust-lang#127367 (Run alloc sync tests) - rust-lang#127431 (Use field ident spans directly instead of the full field span in diagnostics on local fields) - rust-lang#127437 (Uplift trait ref is knowable into `rustc_next_trait_solver`) - rust-lang#127439 (Uplift elaboration into `rustc_type_ir`) - rust-lang#127451 (Improve `run-make/output-type-permutations` code and improve `filename_not_in_denylist` API) - rust-lang#127452 (Fix intrinsic const parameter counting with `effects`) - rust-lang#127459 (rustdoc-json: add type/trait alias tests) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 8, 2024
Rollup of 10 pull requests Successful merges: - rust-lang#126841 ([`macro_metavar_expr_concat`] Add support for literals) - rust-lang#126881 (Make `NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE` a deny-by-default lint in edition 2024) - rust-lang#126921 (Give VaList its own home) - rust-lang#127367 (Run alloc sync tests) - rust-lang#127431 (Use field ident spans directly instead of the full field span in diagnostics on local fields) - rust-lang#127437 (Uplift trait ref is knowable into `rustc_next_trait_solver`) - rust-lang#127439 (Uplift elaboration into `rustc_type_ir`) - rust-lang#127451 (Improve `run-make/output-type-permutations` code and improve `filename_not_in_denylist` API) - rust-lang#127452 (Fix intrinsic const parameter counting with `effects`) - rust-lang#127459 (rustdoc-json: add type/trait alias tests) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 8, 2024
Rollup merge of rust-lang#127431 - oli-obk:feed_item_attrs, r=compiler-errors Use field ident spans directly instead of the full field span in diagnostics on local fields This improves diagnostics and avoids having to store the `DefId`s of fields
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Jul 11, 2024
Rollup of 10 pull requests Successful merges: - rust-lang#126841 ([`macro_metavar_expr_concat`] Add support for literals) - rust-lang#126881 (Make `NEVER_TYPE_FALLBACK_FLOWING_INTO_UNSAFE` a deny-by-default lint in edition 2024) - rust-lang#126921 (Give VaList its own home) - rust-lang#127367 (Run alloc sync tests) - rust-lang#127431 (Use field ident spans directly instead of the full field span in diagnostics on local fields) - rust-lang#127437 (Uplift trait ref is knowable into `rustc_next_trait_solver`) - rust-lang#127439 (Uplift elaboration into `rustc_type_ir`) - rust-lang#127451 (Improve `run-make/output-type-permutations` code and improve `filename_not_in_denylist` API) - rust-lang#127452 (Fix intrinsic const parameter counting with `effects`) - rust-lang#127459 (rustdoc-json: add type/trait alias tests) r? `@ghost` `@rustbot` modify labels: rollup
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Jul 16, 2024
Update method name to reflect changes to its internals forgot to do this in rust-lang#127431
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Jul 16, 2024
Update method name to reflect changes to its internals forgot to do this in rust-lang#127431
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 17, 2024
Rollup merge of rust-lang#127816 - oli-obk:misnomer, r=compiler-errors Update method name to reflect changes to its internals forgot to do this in rust-lang#127431
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This improves diagnostics and avoids having to store the
DefIds of fields