-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fixes incorrect handling of ADT's drop requirements #90218
Conversation
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
Uses 2 MCVEs from the issue tracker that test opposite sides of the problem.
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.
Thank you for the fix.
LGTM, nits only.
Cleaned those up and fixed the function names on a couple others, doing this before had slipped my mind. Thanks! |
nominating because @apiraino was concerned this might get overlooked |
Adding note of the Zulip thread @rustbot label -I-nominated +I-compiler-nominated |
@bors r+ Thanks for the comment explaining the purpose of the PR! Always helpful. |
📌 Commit aff37f8 has been approved by |
@bors p=1 To help stem the tide of reports. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (85c0558): comparison url. Summary: This change led to very large relevant regressions 😿 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
The perf report suggests a significant regression on incremental compilation scenarios (if I correctly read the report): something worth investigating before backporting? |
self.param_env, | ||
required_ty.subst(tcx, substs), | ||
); | ||
let subst_ty = |
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.
Note: I probably would have renamed this variable. I think the reason it was named subst_ty
is because it, prior to this PR, had the substs
applied to it. But that is no longer the case here, if I understand correctly.
Visiting for performance triage this week.
|
thanks @pnkfelix ! |
discussed in T-compiler meeting. backport approved. |
…lacrum Address performance regression introduced by rust-lang#90218 As part of the changes in rust-lang#90218 , the `adt_drop_tys` and friends code stopped recursing through the query system, meaning that intermediate computations did not get cached. This change adds the recursions back in without re-introducing any of the old issues. On local benchmarks this fixes the 5% regressions in rust-lang#90504 ; the wg-grammar regressions didn't seem to move too much. I may take some time later to look into those. Not sure who to request for review here, so will leave it up to whoever gets it.
[beta] backports - Fix assertion failures in OwnedHandle with windows_subsystem. rust-lang#88798 - Ensure that pushing empty path works as before on verbatim paths rust-lang#89665 - Feature gate + make must_not_suspend allow-by-default rust-lang#89826 - Only use clone3 when needed for pidfd rust-lang#89930 - Fix documentation header sizes rust-lang#90186 - Fixes incorrect handling of ADT's drop requirements rust-lang#90218 - Fix ICE when forgetting to Box a parameter to a Self::func call rust-lang#90221 - Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated rust-lang#90266 - Update odht crate to 0.3.1 (big-endian bugfix) rust-lang#90403 - rustdoc: Go back to loading all external crates unconditionally rust-lang#90489 - Split doc_cfg and doc_auto_cfg features rust-lang#90502 - Apply adjustments for field expression even if inaccessible rust-lang#90508 - Warn for variables that are no longer captured rust-lang#90597 - Properly register text_direction_codepoint_in_comment lint. rust-lang#90626 - CI: Use ubuntu image to download openssl, curl sources, cacert.pem for x86 dist builds rust-lang#90457 - Android is not GNU rust-lang#90834 - Update llvm submodule rust-lang#90954 Additionally, this bumps the stage 0 compiler from beta to stable 1.56.1. r? `@Mark-Simulacrum`
Fixes #90024 and a bunch of duplicates.
The main issue was just that the contract of
NeedsDropTypes::adt_components
was inconsistent; the list of types it might return were the generic parameters themselves or the fields of the ADT, depending on the nature of the drop impl. This meant that the caller could not determine whether a.subst()
call was still needed on those types; it called.subst()
in all cases, and this led to ICEs when the returned types were the generic params.First contribution of more than a few lines, so feedback definitely appreciated.