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

syntax: make match arms store the expr directly. #12669

Merged
merged 1 commit into from
Mar 4, 2014

Conversation

huonw
Copy link
Member

@huonw huonw commented Mar 3, 2014

syntax: make match arms store the expr directly.

Previously ast::Arm was always storing a single ast::Expr wrapped in an
ast::Block (for historical reasons, AIUI), so we might as just store
that expr directly.

Closes #3085.

Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an
`ast::Block` (for historical reasons, AIUI), so we might as just store
that expr directly.

Closes rust-lang#3085.
@@ -915,4 +915,3 @@ fn bit_str(bit: uint) -> ~str {
let lobits = 1 << (bit & 0xFF);
format!("[{}:{}-{:02x}]", bit, byte, lobits)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does your editor automatically remove newlines at the end of files? Do we have a policy about it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to remove useless whitespace (e.g. trailing whitespace on lines and entire files).

(Note that this doesn't remove the very last \n, just s/\n+$/\n/ if you'll excuse the regex.)

@flaper87
Copy link
Contributor

flaper87 commented Mar 3, 2014

Travis doesn't like this change but I do ;) Looking good so far. 🍰

@huonw
Copy link
Member Author

huonw commented Mar 3, 2014

The travis failure is spurious (at least, every recent PR is failing with that error).

bors added a commit that referenced this pull request Mar 4, 2014
syntax: make match arms store the expr directly.

Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an
`ast::Block` (for historical reasons, AIUI), so we might as just store
that expr directly.

Closes #3085.
@bors bors closed this Mar 4, 2014
@bors bors merged commit c3b9047 into rust-lang:master Mar 4, 2014
@huonw huonw deleted the de-block-arms branch June 27, 2014 06:48
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AST alt arms should take an expression instead of a block
5 participants