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
Contributor

calebcartwright commented Feb 11, 2020

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

@calebcartwright calebcartwright force-pushed the calebcartwright:half-open-range-syntax branch from 123fc01 to 27f2120 Feb 13, 2020
Copy link
Collaborator

topecongiro left a comment

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

rustfmt-core/rustfmt-lib/src/expr.rs Outdated Show resolved Hide resolved
@calebcartwright calebcartwright force-pushed the calebcartwright:half-open-range-syntax branch from 14da660 to 8c43b43 Feb 18, 2020
@calebcartwright calebcartwright force-pushed the calebcartwright:half-open-range-syntax branch from 8c43b43 to dbf385a Feb 18, 2020
context,
) {
let missing_comments = match rewrite_missing_comment(comments_span, cond_shape, context)
{

This comment has been minimized.

Copy link
@calebcartwright

calebcartwright Feb 18, 2020

Author Contributor

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!

This comment has been minimized.

Copy link
@topecongiro

topecongiro Feb 18, 2020

Collaborator

Yes, let's keep master green 🍏

@topecongiro topecongiro merged commit 3526f32 into rust-lang:master Feb 18, 2020
6 checks passed
6 checks passed
test (i686-pc-windows-gnu, nightly)
Details
test (i686-pc-windows-msvc, nightly)
Details
test (x86_64-pc-windows-gnu, nightly)
Details
test (x86_64-pc-windows-msvc, nightly)
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Copy link
Collaborator

topecongiro left a comment

LGTM, thank you!

@calebcartwright calebcartwright deleted the calebcartwright:half-open-range-syntax branch Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.