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

Remove semicolon from internal err macro #78449

Merged
merged 2 commits into from
Nov 19, 2020

Conversation

Aaron1011
Copy link
Member

This macro is used in expression position (a match arm), and only
compiles because of #33953

Regardless of what happens with that issue, this makes the
usage of the macro less confusing at the call site.

@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 27, 2020
@dtolnay dtolnay added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 27, 2020
@dtolnay
Copy link
Member

dtolnay commented Oct 27, 2020

Er, tidy fails.

Diff in /checkout/library/core/src/str/validations.rs at line 125:
         let old_offset = index;
         macro_rules! err {
             ($error_len: expr) => {
-                return Err(Utf8Error { valid_up_to: old_offset, error_len: $error_len })
+                return Err(Utf8Error { valid_up_to: old_offset, error_len: $error_len });
             };
         }

Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/library/core/src/str/validations.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.

@Aaron1011
Copy link
Member Author

Aaron1011 commented Oct 27, 2020

That's quite unfortunate - there might be a very large amount of code like #33953 in the wild due to rustfmt. I'll work on a rustfmt PR.

@Aaron1011 Aaron1011 added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 27, 2020
This macro is used in expression position (a match arm), and only
compiles because of rust-lang#33953

Regardless of what happens with that issue, this makes the
usage of the macro less confusing at the call site.
This pulls in rust-lang/rustfmt#4507,
allowing us to remove a semicolon in an internal libstd macro
@Aaron1011 Aaron1011 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Nov 19, 2020
@Aaron1011
Copy link
Member Author

@dtolnay: I've added a commit bumping the stage0 rustfmt to a version that accepts this code. This should now be ready to merge

@dtolnay
Copy link
Member

dtolnay commented Nov 19, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Nov 19, 2020

📌 Commit b03d4b0 has been approved by dtolnay

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2020
@bors
Copy link
Contributor

bors commented Nov 19, 2020

⌛ Testing commit b03d4b0 with merge 7e20323...

@bors
Copy link
Contributor

bors commented Nov 19, 2020

☀️ Test successful - checks-actions
Approved by: dtolnay
Pushing 7e20323 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 19, 2020
@bors bors merged commit 7e20323 into rust-lang:master Nov 19, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants