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

Avoid ref when using format! #13130

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Avoid ref when using format! #13130

merged 1 commit into from
Jul 26, 2024

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Jul 19, 2024

Clean up a few minor refs in format! macro, as it has a performance cost. Apparently the compiler is unable to inline format!("{}", &variable), and does a run-time double-reference instead (format macro already does one level referencing).

Inlining format args prevents accidental & misuse.

See also rust-lang/rust#112156

changelog: none

Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing).

Inlining format args prevents accidental `&` misuse.
@rustbot
Copy link
Collaborator

rustbot commented Jul 19, 2024

r? @Centri3

rustbot has assigned @Centri3.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 19, 2024
@Centri3
Copy link
Member

Centri3 commented Jul 26, 2024

Thanks, @bors r+

@bors
Copy link
Collaborator

bors commented Jul 26, 2024

📌 Commit 266abf3 has been approved by Centri3

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jul 26, 2024

⌛ Testing commit 266abf3 with merge 479491e...

@bors
Copy link
Collaborator

bors commented Jul 26, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Centri3
Pushing 479491e to master...

@bors bors merged commit 479491e into rust-lang:master Jul 26, 2024
8 checks passed
@nyurik nyurik deleted the ref-lints branch July 26, 2024 17:39
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants