-
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
Apply adjustments for field expression even if inaccessible #90508
Conversation
The adjustments are used later by ExprUseVisitor to build Place projections and without adjustments it can produce invalid result.
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
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.
LGTM, r=me unless you want to address the nit.
@@ -1729,7 +1729,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
} | |||
self.structurally_resolved_type(autoderef.span(), autoderef.final_ty(false)); | |||
|
|||
if let Some((did, field_ty)) = private_candidate { | |||
if let Some((adjustments, did, field_ty)) = private_candidate { | |||
// (#90483) apply adjustments to avoid ExprUseVisitor from |
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.
nit: I'm not sure that this comment is necessary.
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.
I think it's better to have it because usually we don't care much once an error is emitted, but for this one adjustment is needed to avoid ICEing despite emitted error.
@bors r+ |
📌 Commit f556075 has been approved by |
Apply adjustments for field expression even if inaccessible The adjustments are used later by ExprUseVisitor to build Place projections and without adjustments it can produce invalid result. Fix rust-lang#90483 `@rustbot` label: T-compiler
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#90487 (Add a chapter on reading Rustdoc output) - rust-lang#90508 (Apply adjustments for field expression even if inaccessible) - rust-lang#90627 (Suggest dereference of `Box` when inner type is expected) - rust-lang#90642 (use matches!() macro in more places) - rust-lang#90646 (type error go brrrrrrrr) - rust-lang#90649 (Run reveal_all on MIR when inlining is activated.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Needs backport as this is a stable-to-stable regression |
@nbdd0121 @davidtwco would this patch warrant also a backport to stable? |
This is an error to ICE regression, so not worth a dot release. |
(But if there is going to be a point release then it could be included) |
[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`
The adjustments are used later by ExprUseVisitor to build Place projections and without adjustments it can produce invalid result.
Fix #90483
@rustbot label: T-compiler