-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
head expression => scrutinee #59691
head expression => scrutinee #59691
Conversation
This comment has been minimized.
This comment has been minimized.
5cb9ffd
to
36c5b9f
Compare
cc @rust-lang/lang |
ping from triage @matthewjasper waiting for your review on this |
Match(ref head, _) => (head, "`match` head expression", true), | ||
IfLet(_, ref cond, ..) => (cond, "`if let` scrutinee", true), | ||
WhileLet(_, ref cond, ..) => (cond, "`while let` scrutinee", true), | ||
ForLoop(_, ref cond, ..) => (cond, "`for` scrutinee", true), |
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'm not sure "scrutinee" is correct here. The obvious "iterator expression" isn't really correct either, since it only has to implement IntoIterator
. I guess this is fine for now.
@@ -1011,22 +1011,22 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) { | |||
visitor.visit_expr(subexpression); | |||
visitor.visit_ty(typ) | |||
} | |||
ExprKind::If(ref head_expression, ref if_block, ref optional_else) => { | |||
visitor.visit_expr(head_expression); | |||
ExprKind::If(ref scrutinee, ref if_block, ref optional_else) => { |
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.
For If
and While
this should be condition
(although I guess this code is going away soon).
☔ The latest upstream changes (presumably #60296) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @matthewjasper
See https://doc.rust-lang.org/nightly/reference/glossary.html#scrutinee.
I believe there are uses of "discriminant" elsewhere that should be changed to "scrutinee" but that is not for this PR.