Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Apr 4, 2019

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 4, 2019
@rust-highfive

This comment has been minimized.

@Centril Centril force-pushed the head-is-scrutinee branch from 5cb9ffd to 36c5b9f Compare April 4, 2019 14:29
@matthewjasper
Copy link
Contributor

cc @rust-lang/lang

@Dylan-DPC-zz
Copy link

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),
Copy link
Contributor

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) => {
Copy link
Contributor

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).

@bors
Copy link
Contributor

bors commented Apr 26, 2019

☔ The latest upstream changes (presumably #60296) made this pull request unmergeable. Please resolve the merge conflicts.

@Centril Centril closed this May 18, 2019
@Centril Centril deleted the head-is-scrutinee branch May 18, 2019 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants