Remove semicolon from internal err macro#78449
Merged
bors merged 2 commits intorust-lang:masterfrom Nov 19, 2020
Merged
Conversation
Contributor
|
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
dtolnay
approved these changes
Oct 27, 2020
Member
|
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. |
Contributor
Author
|
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. |
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
84131cb to
b03d4b0
Compare
Contributor
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
approved these changes
Nov 19, 2020
Member
|
@bors r+ |
Collaborator
|
📌 Commit b03d4b0 has been approved by |
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.