-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Return all opaques in typeck results #111705
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit d3dae85 with merge ff144bedfc2b16d3cfc9b750cf881653a49de873... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ff144bedfc2b16d3cfc9b750cf881653a49de873): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking 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 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 645.339s -> 642.785s (-0.40%) |
// For backwards compatibility, we choose the first matching | ||
// opaque type definition |
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.
What happens if we check all of them?
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.
It's not that we have to check them, it's that we have to merge them. I guess I could do that. (nvm we don't have to merge them, they've all been passed thru remap_generic_params_to_declaration_params
already)
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.
r=me with that
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.
Wait wait wait... We've remapped all of the hidden types back to their declaration params. We don't need to put the substs in the writeback results at all. 🤦
Gonna rework this PR. Seems like it's also not exactly necessary for my opaques PR to land. |
…i-obk Check opaques for mismatch during writeback Revive rust-lang#111705. I realized that we don't need to put any substs in the writeback results since all of the hidden types have already been remapped. See the comment in `compiler/rustc_middle/src/ty/typeck_results.rs`, which should make that clear for other explorers of the codebase. Additionally, we need to do some diagnostic stashing because the diagnostics we produce during HIR typeck is very poor and we should prefer the diagnostic that comes from MIR, if we have one. r? `@oli-obk`
Return all (erased) opaque keys in writeback results, not just one type per opaque def id. This will be useful for guiding opaque type inference during borrowck with the new trait solver.
This also fixes a subtle corner case with opaque constraints and dead code, though it's not really a super compelling use-case, lol. Just a side effect of the more important reasoning for the change above.
r? @oli-obk