Skip to content

Don't call Span::with_parent on the good path in has_stashed_diagnostic #139468

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

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Apr 7, 2025

More unnecessary incurred span tracking avoided by not calling span.with_parent(None). This is useless on its own but makes it much easier to fix other "span tracking on the good path" issues in the future.

r? oli-obk

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 7, 2025
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 7, 2025
@bors
Copy link
Collaborator

bors commented Apr 7, 2025

⌛ Trying commit 253da2f with merge 5336b4a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 7, 2025
…ic, r=<try>

Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`

More unnecessary incurred span tracking avoided by not calling `span.with_parent(None)`.

r? oli-obk
@@ -983,7 +991,14 @@ impl<'a> DiagCtxtHandle<'a> {
}

pub fn has_stashed_diagnostic(&self, span: Span, key: StashKey) -> bool {
self.inner.borrow().stashed_diagnostics.get(&(span.with_parent(None), key)).is_some()
let inner = self.inner.borrow();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may wonder... is it sufficient here to just call self.inner.borrow().stashed_diagnostics.is_empty() as a fast path, b/c we obviously should never have stashed diagnostics on the good path?

Well no! We stash AssociatedTypeSuggestion in a bunch of places on the good path! What the heck, lol. I'll open a separate PR to gauge the perf impact of that.

@bors
Copy link
Collaborator

bors commented Apr 7, 2025

☀️ Try build successful - checks-actions
Build commit: 5336b4a (5336b4a39d2955d5ae9606b177e4baef7acfeb1f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5336b4a): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 779.04s -> 777.727s (-0.17%)
Artifact size: 365.93 MiB -> 365.94 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 7, 2025
@compiler-errors compiler-errors marked this pull request as ready for review April 7, 2025 14:50
@compiler-errors
Copy link
Member Author

@bors rollup=maybe

@oli-obk
Copy link
Contributor

oli-obk commented Apr 7, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 7, 2025

📌 Commit 253da2f has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 7, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 7, 2025
…stic, r=oli-obk

Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`

More unnecessary incurred span tracking avoided by not calling `span.with_parent(None)`. This is useless on its own but makes it much easier to fix other "span tracking on the good path" issues in the future.

r? oli-obk
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 7, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#139124 (compiler: report error when trait object type param reference self)
 - rust-lang#139346 (Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`)
 - rust-lang#139379 (Use delayed bug for normalization errors in drop elaboration)
 - rust-lang#139421 (Fix trait upcasting to dyn type with no principal when there are projections)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139476 (rm `RegionInferenceContext::var_infos`)
 - rust-lang#139490 (Update some comment/docs related to "extern intrinsic" removal)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 7, 2025
…stic, r=oli-obk

Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`

More unnecessary incurred span tracking avoided by not calling `span.with_parent(None)`. This is useless on its own but makes it much easier to fix other "span tracking on the good path" issues in the future.

r? oli-obk
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 8, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#139124 (compiler: report error when trait object type param reference self)
 - rust-lang#139346 (Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`)
 - rust-lang#139421 (Fix trait upcasting to dyn type with no principal when there are projections)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139476 (rm `RegionInferenceContext::var_infos`)
 - rust-lang#139490 (Update some comment/docs related to "extern intrinsic" removal)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 8, 2025
…stic, r=oli-obk

Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`

More unnecessary incurred span tracking avoided by not calling `span.with_parent(None)`. This is useless on its own but makes it much easier to fix other "span tracking on the good path" issues in the future.

r? oli-obk
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 8, 2025
…errors

Rollup of 19 pull requests

Successful merges:

 - rust-lang#138676 (Implement overflow for infinite implied lifetime bounds)
 - rust-lang#139024 (Make error message for missing fields with `..` and without `..` more consistent)
 - rust-lang#139098 (Tell LLVM about impossible niche tags)
 - rust-lang#139124 (compiler: report error when trait object type param reference self)
 - rust-lang#139321 (Update to new rinja version (askama))
 - rust-lang#139346 (Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`)
 - rust-lang#139386 (make it possible to use stage0 libtest on compiletest)
 - rust-lang#139421 (Fix trait upcasting to dyn type with no principal when there are projections)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139476 (rm `RegionInferenceContext::var_infos`)
 - rust-lang#139481 (Add job summary links to post-merge report)
 - rust-lang#139485 (compiletest: Stricter parsing for diagnostic kinds)
 - rust-lang#139490 (Update some comment/docs related to "extern intrinsic" removal)
 - rust-lang#139491 (Update books)
 - rust-lang#139496 (Revert r-a changes of rust-lang#139455)
 - rust-lang#139500 (document panic behavior of Vec::resize and Vec::resize_with)
 - rust-lang#139501 (Fix stack overflow in exhaustiveness due to recursive HIR opaque hidden types)
 - rust-lang#139504 (add missing word in doc comment)
 - rust-lang#139507 (compiletest: Trim whitespace from environment variable names)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 9, 2025
…stic, r=oli-obk

Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`

More unnecessary incurred span tracking avoided by not calling `span.with_parent(None)`. This is useless on its own but makes it much easier to fix other "span tracking on the good path" issues in the future.

r? oli-obk
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 9, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#137412 (Ensure `swap_nonoverlapping` is really always untyped)
 - rust-lang#138869 (Try not to use verbatim paths in `Command::current_dir`)
 - rust-lang#138993 (Make `cfg_match!` a semitransparent macro)
 - rust-lang#139099 (Promise `array::from_fn` is generated in order of increasing indices)
 - rust-lang#139364 (Make the compiler suggest actual paths instead of visible paths if the visible paths are through any doc hidden path.)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139481 (Add job summary links to post-merge report)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 9, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#138869 (Try not to use verbatim paths in `Command::current_dir`)
 - rust-lang#138993 (Make `cfg_match!` a semitransparent macro)
 - rust-lang#139099 (Promise `array::from_fn` is generated in order of increasing indices)
 - rust-lang#139364 (Make the compiler suggest actual paths instead of visible paths if the visible paths are through any doc hidden path.)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139481 (Add job summary links to post-merge report)
 - rust-lang#139573 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 9, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#138869 (Try not to use verbatim paths in `Command::current_dir`)
 - rust-lang#138993 (Make `cfg_match!` a semitransparent macro)
 - rust-lang#139099 (Promise `array::from_fn` is generated in order of increasing indices)
 - rust-lang#139364 (Make the compiler suggest actual paths instead of visible paths if the visible paths are through any doc hidden path.)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139481 (Add job summary links to post-merge report)
 - rust-lang#139573 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit db7e32c into rust-lang:master Apr 9, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 9, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 9, 2025
Rollup merge of rust-lang#139468 - compiler-errors:has_stashed_diagnostic, r=oli-obk

Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`

More unnecessary incurred span tracking avoided by not calling `span.with_parent(None)`. This is useless on its own but makes it much easier to fix other "span tracking on the good path" issues in the future.

r? oli-obk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants