Skip to content

Normalize return type of deduce_future_output_from_obligations #114914

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
Aug 20, 2023

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Aug 16, 2023

Fixes #114909
Also confirmed to fix #114727 manually

Now that we have weak/lazy type aliases, we need to normalize those in future signatures to ensure that replace_opaque_types_with_inference_vars actually sees TAITs behind them. This isn't needed in the new solver, but added a test to make sure it doesn't regress there either.

r? types cc @oli-obk (who's gone, worst case can delay this PR until he's back)

@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 Aug 16, 2023
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.

r=me after handling nit (or without it 😁)

"async fn generator return type not an inference variable: {ret_ty}"
),
};

let output_ty = self.normalize(span, output_ty);
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 move the normalize call into the ty::Alias branch? for infer vars the obligation should already be normalized

Copy link
Member Author

Choose a reason for hiding this comment

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

That's the alias that corresponds to the impl Future. The type we want to normalize here is the Output of that future, which depends on what we extract out of get_future_output.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wait, wait, I think I understand here.

Copy link
Member Author

@compiler-errors compiler-errors Aug 19, 2023

Choose a reason for hiding this comment

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

Actually, we still may have unnormalized obligations for infer vars as well. The obligations returned from replace_opaque_with_infer and handle_opaque_ty are not normalized.

@lcnr lcnr 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 Aug 18, 2023
@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Aug 19, 2023

📌 Commit 2cc71ba has been approved by lcnr

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 19, 2023

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 19, 2023
@bors
Copy link
Collaborator

bors commented Aug 20, 2023

⌛ Testing commit 2cc71ba with merge 39e0749...

@bors
Copy link
Collaborator

bors commented Aug 20, 2023

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 39e0749 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 20, 2023
@bors bors merged commit 39e0749 into rust-lang:master Aug 20, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 20, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (39e0749): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results

This 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.

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

Cycles

Results

This 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.

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

Binary size

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

Bootstrap: 635.452s -> 636.001s (0.09%)
Artifact size: 347.05 MiB -> 346.92 MiB (-0.04%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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
5 participants