Skip to content

Conversation

@BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Jan 19, 2026

r? lcnr

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 19, 2026
Comment on lines 185 to 186
if let Err(_) =
self.eq_types(a, b, Locations::All(span), ConstraintCategory::BoringNoLocation)
{
Copy link
Member Author

Choose a reason for hiding this comment

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

i assume removing this "fast path" is perf sensitive so will do a perf run 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

like 0.2% in a few secondary benchmarks #151374 (comment)

I don't think a simple cleanup of yeeting this is worth it given those results?

Copy link
Contributor

Choose a reason for hiding this comment

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

can you instead do

if infcx.next_Trait_solver() {
    return eq_types();
}

and then keep the old body with updated comments, rn the formatting is kinda ass here

Copy link
Member Author

Choose a reason for hiding this comment

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

no because eq_types is massive with the bug afterwards 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

i guess you can just go and stabilize new solver and then the duplication is unimportant 😌

@@ -1,4 +1,7 @@
//@ build-pass
//@ revisions: current next
Copy link
Member Author

Choose a reason for hiding this comment

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

all of these are tests that fail in the old solver if you remove the normalization in equate_normalized_input_or_output

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Jan 19, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 19, 2026
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 19, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 19, 2026

☀️ Try build successful (CI)
Build commit: 97360bc (97360bc76d9408f19d17edb2abcda5774e0132cf, parent: d940e56841ddcc05671ead99290e35ff2e98369f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (97360bc): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking 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
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.3%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.0%, secondary 5.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
5.7% [4.3%, 7.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.0% [2.0%, 2.0%] 1

Cycles

Results (primary 2.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Binary size

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

Bootstrap: 473.058s -> 474.427s (0.29%)
Artifact size: 383.29 MiB -> 383.36 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 19, 2026
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Jan 20, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 20, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 20, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 20, 2026

☀️ Try build successful (CI)
Build commit: e28fa5a (e28fa5a4bbbf7c674c73962c058f6c9f02e1ba82, parent: 79818181387879de7a521366d9bea23624728462)

@rust-timer

This comment has been minimized.

@BoxyUwU BoxyUwU force-pushed the borrowck_cleanup_3 branch 3 times, most recently from f330bf8 to df106b6 Compare January 20, 2026 14:33
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e28fa5a): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking 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
@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)

Results (primary -2.0%, secondary 1.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.1% [2.4%, 4.4%] 3
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 1

Cycles

Results (secondary 2.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [2.0%, 3.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.0%, secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 3
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 3

Bootstrap: 473.092s -> 474.982s (0.40%)
Artifact size: 383.30 MiB -> 383.28 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 20, 2026
"there should be no incoming region assumptions = {pre_assumptions:#?}",
);
{
// Scope these variables so it's clear they're not used later
Copy link
Member Author

Choose a reason for hiding this comment

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

this seemed kinda scary to me when i was reading it :> but i think this would have made it not seem so scary

@BoxyUwU BoxyUwU marked this pull request as ready for review January 20, 2026 14:39
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 20, 2026
);
}

// Return types are a bit more complex. They may contain opaque `impl Trait` types.
Copy link
Member Author

Choose a reason for hiding this comment

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

Am I missing something here? The actual logic here is no more complex than any of the previous relations we do.

Comment on lines -193 to -195
// Note: if we have to introduce new placeholders during normalization above, then we
// won't have added those universes to the universe info, which we would want in
// `relate_tys`.
Copy link
Member Author

Choose a reason for hiding this comment

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

i am missing something here. This comment would seem to imply we do things differently to avoid calling relate_types (note taht there is no such thing as relate_tys) but eq_types is a trivial wrapper around relate_tys.

I guess the point is that there will be universes made during the normalization call which this eq_types is unaware of the origin for? I don't quite get why this is worth calling out, but maybe it's worth keeping this :>

Copy link
Member Author

Choose a reason for hiding this comment

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

at minimum I think I'd want to move this comment to the actual normalize call as that's where the source of the "weirdness" is? but also we don't have a similar comment in other places we normalize and maybe we should if we do want this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also do not get this comment. I don't think it's relevant 🤔

@BoxyUwU BoxyUwU force-pushed the borrowck_cleanup_3 branch 2 times, most recently from 1138d91 to a60d529 Compare January 21, 2026 16:09
@BoxyUwU BoxyUwU force-pushed the borrowck_cleanup_3 branch from a60d529 to d7d439c Compare January 21, 2026 16:11
#[instrument(skip(self), level = "debug")]
fn equate_normalized_input_or_output(&mut self, a: Ty<'tcx>, b: Ty<'tcx>, span: Span) {
if self.infcx.next_trait_solver() {
self.eq_types(a, b, Locations::All(span), ConstraintCategory::BoringNoLocation)
Copy link
Contributor

Choose a reason for hiding this comment

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

need to return xd

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants