Skip to content

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Sep 16, 2025

the types returned by Autoderef are always structurally resolved, cc #145990.

r? @BoxyUwU

@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 Sep 16, 2025
@lcnr
Copy link
Contributor Author

lcnr commented Sep 16, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 16, 2025
remove unnecessary `structurally_resolve_type`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 16, 2025
@lcnr lcnr force-pushed the yeet-unnecessary-resolve branch from a6ae1f4 to c7e140b Compare September 16, 2025 12:59
@rust-bors
Copy link

rust-bors bot commented Sep 16, 2025

☀️ Try build successful (CI)
Build commit: 7b0b20b (7b0b20b50949e22139fbb41bcaa65e97622d2e76, parent: eec6bd9d69832f57341c6de6a93fa7b9f47e2111)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7b0b20b): comparison URL.

Overall result: ✅ improvements - 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.1%] 8
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -1.8%, secondary -1.2%)

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

mean range count
Regressions ❌
(primary)
4.9% [4.9%, 4.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-8.4% [-8.4%, -8.4%] 1
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) -1.8% [-8.4%, 4.9%] 2

Cycles

Results (secondary -2.1%)

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
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 473.048s -> 473.468s (0.09%)
Artifact size: 390.57 MiB -> 390.59 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 16, 2025
index_ty: Ty<'tcx>,
index_expr: &hir::Expr<'_>,
) -> Option<(/*index type*/ Ty<'tcx>, /*element type*/ Ty<'tcx>)> {
let adjusted_ty = self.structurally_resolve_type(autoderef.span(), autoderef.final_ty());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this means we no longer eagerly error on infer vars here. surprised we don't have a test for it. needs test + check for infer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think

fn foo() {
    let x = &Default::default();
    x[1];
    let _: &Vec<()> = x;
}
``` would work

@BoxyUwU BoxyUwU added the S-no-work-capacity-tracking Status: Exempted from triagebot work capacity tracking. label Sep 18, 2025
@lcnr lcnr marked this pull request as draft September 26, 2025 13:01
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 26, 2025
@bors
Copy link
Collaborator

bors commented Sep 26, 2025

☔ The latest upstream changes (presumably #146885) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-no-work-capacity-tracking Status: Exempted from triagebot work capacity tracking. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants