-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Clarify the usage of "hints" in const_eval. #26683
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
c05e030
to
a745d0c
Compare
☔ The latest upstream changes (presumably #26757) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @pnkfelix (random person from the compiler subteam) |
substs), | ||
Some(&**ty)) | ||
if let ExprTypeChecked = ty_hint { | ||
let substs = tcx.node_id_item_substs(e.id).substs; |
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 took me a little while to convince myself that this ends up being equivalent to the effect we were getting before via the get_substs
parameter, but I now believe the tables in the tcx
should match even in the case where check::_match::check_pat
was passing in a closure that calls fcx.item_substs()
, so this should be okay.)
@eefriedman I'm basically all in favor of this PR. I've put some feedback up above but you can treat it as an r=me after a rebase. |
a745d0c
to
a1b2d40
Compare
The "hint" mechanism is essentially used as a workaround to compute types for expressions which have not yet been type-checked. This commit clarifies that usage, and limits the effects to the places where it is currently necessary. Fixes rust-lang#26210.
a1b2d40
to
6bdfb05
Compare
Rebased. |
ping @pnkfelix |
@bors r+ |
📌 Commit 6bdfb05 has been approved by |
The "hint" mechanism is essentially used as a workaround to compute types for expressions which have not yet been type-checked. This commit clarifies that usage, and limits the effects to the places where it is currently necessary. Fixes #26210.
The "hint" mechanism is essentially used as a workaround to compute
types for expressions which have not yet been type-checked. This
commit clarifies that usage, and limits the effects to the places
where it is currently necessary.
Fixes #26210.