Stop using Key trait unnecessarily#143441
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 6, 2025
Merged
Conversation
Collaborator
|
rustbot has assigned @petrochenkov. Use |
Collaborator
compiler-errors
commented
Jul 4, 2025
|
|
||
| let ecx = | ||
| InterpCx::new(tcx, ty.default_span(tcx), key.typing_env, crate::const_eval::DummyMachine); | ||
| let ecx = InterpCx::new(tcx, DUMMY_SP, key.typing_env, crate::const_eval::DummyMachine); |
Contributor
Author
There was a problem hiding this comment.
We don't need this span anyways, and even if we did, it would be nice to use a relevant def span since it's just an enum anyways.
compiler-errors
commented
Jul 4, 2025
| .span_of_impl(*id) | ||
| .unwrap_or(default_span), | ||
| argument_label: args[0].span, | ||
| map_label: arg_ty.default_span(cx.tcx), |
Contributor
Author
There was a problem hiding this comment.
This was DUMMY_SP, but dummy span labels fall back to the primary span coincidentally (lol)
Key trait randomlyKey trait unnecessarily
This comment has been minimized.
This comment has been minimized.
Contributor
|
r=me after updating the test outputs. |
Contributor
Author
|
@bors r=petrochenkov rollup |
Collaborator
bors
added a commit
that referenced
this pull request
Jul 5, 2025
Rollup of 6 pull requests Successful merges: - #143238 (Port `#[ignore]` to the new attribute parsing infrastructure) - #143441 (Stop using `Key` trait unnecessarily) - #143478 (Miri subtree update) - #143486 (remove armv5te-unknown-linux-gnueabi target maintainer) - #143489 (Complete rustc_ast::mut_visit for spans.) - #143494 (Remove yields_in_scope from the scope tree.) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Jul 6, 2025
Rollup of 6 pull requests Successful merges: - #143238 (Port `#[ignore]` to the new attribute parsing infrastructure) - #143441 (Stop using `Key` trait unnecessarily) - #143478 (Miri subtree update) - #143486 (remove armv5te-unknown-linux-gnueabi target maintainer) - #143489 (Complete rustc_ast::mut_visit for spans.) - #143494 (Remove yields_in_scope from the scope tree.) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Jul 6, 2025
Rollup merge of #143441 - compiler-errors:no-key, r=petrochenkov Stop using `Key` trait unnecessarily Few places where the `Key` trait was being used but not really for a useful reason. This fixes those usages. Namely, `<Ty as Key>::default_span()` is `DUMMY_SP` anyways.
github-actions bot
pushed a commit
to devnexen/miri
that referenced
this pull request
Jul 7, 2025
Rollup of 6 pull requests Successful merges: - rust-lang/rust#143238 (Port `#[ignore]` to the new attribute parsing infrastructure) - rust-lang/rust#143441 (Stop using `Key` trait unnecessarily) - rust-lang/rust#143478 (Miri subtree update) - rust-lang/rust#143486 (remove armv5te-unknown-linux-gnueabi target maintainer) - rust-lang/rust#143489 (Complete rustc_ast::mut_visit for spans.) - rust-lang/rust#143494 (Remove yields_in_scope from the scope tree.) r? `@ghost` `@rustbot` modify labels: rollup
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.
Few places where the
Keytrait was being used but not really for a useful reason. This fixes those usages.Namely,
<Ty as Key>::default_span()isDUMMY_SPanyways.