-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
extract ConstKind::Unevaluated
into a struct
#83040
Conversation
This comment has been minimized.
This comment has been minimized.
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 that after the valtree PR we should move promoteds out of ty::ConstKind::Unevaluated
and directly as an option in mir::Constant
, as that's the only place they can occur.
(ty::ConstKind::Unevaluated(au), ty::ConstKind::Unevaluated(bu)) | ||
if tcx.features().const_evaluatable_checked && !relation.visit_ct_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.
you lost the check for !promoted
, though afaict you can just assert that actually
@@ -430,7 +430,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> { | |||
|
|||
GenericArgKind::Const(constant) => { | |||
match constant.val { | |||
ty::ConstKind::Unevaluated(def, substs, promoted) => { | |||
ty::ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }) => { |
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.
PredicateKind::ConstEvaluatable could take a ty::Unevaluated
, but considering that it can't take promoteds... maybe not
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.
once val-tree
is further ahead we should do that 👍
rebased this on #83086 for now, as there are no merge conflicts there this might not actually be needed. |
This comment has been minimized.
This comment has been minimized.
uh... I don't see how these two PRs relate except that both of them are a prerequisite for making |
removed that commit again 😆 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is still in draft mode, but seems fine to me |
@oli-obk was that intended as an I think it makes sense to merge this change as is. |
@bors r+ yea, should have been clearer on that :D |
📌 Commit 78c87fc has been approved by |
☔ The latest upstream changes (presumably #82936) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r+ |
📌 Commit 2885ca3 has been approved by |
Rollup of 6 pull requests Successful merges: - rust-lang#82707 (const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable`) - rust-lang#83040 (extract `ConstKind::Unevaluated` into a struct) - rust-lang#83280 (Fix pluralization in keyword docs) - rust-lang#83289 (Move some tests to more reasonable directories - 5) - rust-lang#83306 (Extend `proc_macro_back_compat` lint to `js-sys`) - rust-lang#83327 (Extend comment in `UsedLocals::visit_lhs`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
r? @oli-obk