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

Use format args capture #100589

Closed
wants to merge 3 commits into from
Closed

Use format args capture #100589

wants to merge 3 commits into from

Conversation

Rageking8
Copy link
Contributor

@Rageking8 Rageking8 commented Aug 15, 2022

Use format args capture is some places to make the usage more uniform.

lexer\mod
lexer\tokentrees
lexer\unicode_chars
lexer\unescape_error_reporting
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 15, 2022
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jackh726 (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 15, 2022
@rust-log-analyzer

This comment has been minimized.

@est31
Copy link
Member

est31 commented Aug 15, 2022

FTR, if you intend to file subsequent PRs, I would suggest waiting for rust-lang/rust-clippy#9233 and then using rustfix rather than doing it manually (I hope it's rustfix-able?).

parser\attr
parser\expr
parser\attr_wrapper
@compiler-errors
Copy link
Member

Yeah, thanks a bunch for the contributions! but doing these manually is a bit of a waste of time compared to automating the fix.

@@ -131,7 +131,7 @@ impl<'a> StringReader<'a> {
) -> DiagnosticBuilder<'a, !> {
self.sess
.span_diagnostic
.struct_span_fatal(self.mk_sp(from_pos, to_pos), &format!("{}: {}", m, escaped_char(c)))
.struct_span_fatal(self.mk_sp(from_pos, to_pos), &format!("{m}: {}", escaped_char(c)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Mixing different types of capture in one format string isn't nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should be fine, since they are all pretty short and in order. But, I can revert those if necessary.

@flip1995
Copy link
Member

I hope it's rustfix-able?

Yes, this lint will be rustfix-able.

@bors
Copy link
Contributor

bors commented Aug 28, 2022

☔ The latest upstream changes (presumably #100497) made this pull request unmergeable. Please resolve the merge conflicts.

@Rageking8 Rageking8 closed this Sep 7, 2022
@Rageking8 Rageking8 deleted the use-format-args-capture branch September 15, 2022 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants