-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hir: Refactor getters for owner nodes #120346
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
@@ -53,7 +53,7 @@ impl Foo { | |||
#[cfg(not(any(cfail1,cfail4)))] | |||
#[rustc_clean(cfg="cfail2")] | |||
#[rustc_clean(cfg="cfail3")] | |||
#[rustc_clean(cfg="cfail5")] | |||
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what made the incremental tests change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @cjgillot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this PR MaybeOwner::Phantom
was returned either when that was the entry (can that happen?) or when there was no entry. Now there is a difference between None
and MaybeOwner::Phantom
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the current logic is tcx.hir_crate(()).owners.get(id)?.as_owner().map(|i| &i.nodes)
, that means None
is returned for all cases without actual .nodes
(no entry, Phantom
entry, NonOwner
entry).
So, I'd expect the opposite effect - more clean queries, not less.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is due to relative spans, which are sensitive to the number of characters in the item's span. By adding the opt_ prefix, you have more characters in inside the curly braces than the original version has. This is the reason for the silly filler comments.
TBH, I'm starting to reconsider the usefulness of these filler comments, and go towards testing the realistic version.
The query accept arbitrary DefIds, not just owner DefIds. The return can be an `Option` because if there are no nodes, then it doesn't matter whether it's due to NonOwner or Phantom. Also rename the query to `opt_hir_owner_nodes`.
Ok, I have updated the padding comments in incremental tests. |
@bors r+ |
hir: Refactor getters for owner nodes
hir: Refactor getters for owner nodes
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#120207 (check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test) - rust-lang#120321 (pattern_analysis: cleanup the contexts) - rust-lang#120346 (hir: Refactor getters for owner nodes) - rust-lang#120396 (Account for unbounded type param receiver in suggestions) - rust-lang#120435 (Suggest name value cfg when only value is used for check-cfg) - rust-lang#120470 (Mark "unused binding" suggestion as maybe incorrect) - rust-lang#120495 (Remove the `abi_amdgpu_kernel` feature) - rust-lang#120501 (rustdoc: Correctly handle attribute merge if this is a glob reexport) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#120207 (check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test) - rust-lang#120321 (pattern_analysis: cleanup the contexts) - rust-lang#120346 (hir: Refactor getters for owner nodes) - rust-lang#120396 (Account for unbounded type param receiver in suggestions) - rust-lang#120435 (Suggest name value cfg when only value is used for check-cfg) - rust-lang#120470 (Mark "unused binding" suggestion as maybe incorrect) - rust-lang#120495 (Remove the `abi_amdgpu_kernel` feature) - rust-lang#120501 (rustdoc: Correctly handle attribute merge if this is a glob reexport) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 12 pull requests Successful merges: - rust-lang#120207 (check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test) - rust-lang#120321 (pattern_analysis: cleanup the contexts) - rust-lang#120323 (On E0277 be clearer about implicit `Sized` bounds on type params and assoc types) - rust-lang#120355 (document `FromIterator for Vec` allocation behaviors) - rust-lang#120396 (Account for unbounded type param receiver in suggestions) - rust-lang#120430 (std: thread_local::register_dtor fix proposal for FreeBSD.) - rust-lang#120435 (Suggest name value cfg when only value is used for check-cfg) - rust-lang#120470 (Mark "unused binding" suggestion as maybe incorrect) - rust-lang#120472 (Make duplicate lang items fatal) - rust-lang#120490 (Don't hash lints differently to non-lints.) - rust-lang#120495 (Remove the `abi_amdgpu_kernel` feature) - rust-lang#120501 (rustdoc: Correctly handle attribute merge if this is a glob reexport) Failed merges: - rust-lang#120346 (hir: Refactor getters for owner nodes) r? `@ghost` `@rustbot` modify labels: rollup
☀️ Test successful - checks-actions |
Finished benchmarking commit (d53ddcd): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 661.683s -> 661.023s (-0.10%) |
hir: Remove the generic type parameter from `MaybeOwned` It's only ever used with a reference to `OwnerInfo` as an argument. Follow up to rust-lang#120346.
Rollup merge of rust-lang#120610 - petrochenkov:maybeownogen, r=cjgillot hir: Remove the generic type parameter from `MaybeOwned` It's only ever used with a reference to `OwnerInfo` as an argument. Follow up to rust-lang#120346.
hir: Refactor getters for owner nodes
No description provided.