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

support formatting half open ranges #4044

Merged
merged 2 commits into from
Feb 18, 2020

Conversation

calebcartwright
Copy link
Member

Adds support for formatting half open range syntax (X.., ..X, and ..=X).

In #4022 the rustc-ap-* crates were upgraded so that rustfmt will no longer throw a parser error on the half open range syntax, but this PR actually supports formatting those ranges.

Resolves #4009
Refs rust-lang/rust#67264
Refs rust-lang/rust#67258
Refs rust-lang/rust#68120

Copy link
Contributor

@topecongiro topecongiro left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! LGTM with the comment resolved.

context,
) {
let missing_comments = match rewrite_missing_comment(comments_span, cond_shape, context)
{
Copy link
Member Author

Choose a reason for hiding this comment

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

This change (dbf385a) was simply to fix the misformatting here that snuck in #4055 due to temporary state of disabled tests/other formatting issues on master.

I presume it's okay to tack this on with this PR, though let me know if not!

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, let's keep master green 🍏

@topecongiro topecongiro merged commit 3526f32 into rust-lang:master Feb 18, 2020
Copy link
Contributor

@topecongiro topecongiro left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@calebcartwright calebcartwright deleted the half-open-range-syntax branch February 19, 2020 02:42
@karyon
Copy link
Contributor

karyon commented Oct 25, 2021

backported in #4105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo fmt fails with half_open_range_patterns
3 participants