-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Conversation
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
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. |
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
@dtolnay: I've added a commit bumping the stage0 rustfmt to a version that accepts this code. This should now be ready to merge |
@bors r+ |
📌 Commit b03d4b0 has been approved by |
☀️ Test successful - checks-actions |
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.