Skip to content

Fix suggestions for names captured by formatting macros - #162787

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
chenyukang:yukang-fix-105520-format-captured-fields
Sep 16, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
chenyukang:yukang-fix-105520-format-captured-fields

Conversation

@chenyukang

@chenyukang chenyukang commented Sep 14, 2026

Copy link
Copy Markdown
Member

Fixes #105520

also improve #141136.
but still can not handle #96999.

r? @ghost

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 14, 2026
@chenyukang

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 14, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
…fields, r=<try>

Fix suggestions for names captured by formatting macros
@rust-log-analyzer

This comment has been minimized.

@chenyukang
chenyukang force-pushed the yukang-fix-105520-format-captured-fields branch from e20cdd1 to 10874a5 Compare September 14, 2026 23:42
@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6316d90 (6316d901580469b6131d6b3f119c43ea260cb5bf)
Base parent: 574ff7d (574ff7d98bd6d037e5236a8453029173b32631fd)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6316d90): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.5%, -0.4%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.0% [1.3%, 7.3%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.9% [-4.4%, -3.4%] 2
All ❌✅ (primary) - - 0

Cycles

Results (primary -3.2%, secondary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
8.1% [7.7%, 8.4%] 2
Improvements ✅
(primary)
-3.2% [-3.2%, -3.2%] 1
Improvements ✅
(secondary)
-5.3% [-7.5%, -3.0%] 7
All ❌✅ (primary) -3.2% [-3.2%, -3.2%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 496.664s -> 496.202s (-0.09%)
Artifact size: 406.89 MiB -> 406.87 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 15, 2026
@chenyukang
chenyukang marked this pull request as ready for review September 15, 2026 01:24
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2026
@rustbot

rustbot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 15, 2026
@chenyukang

chenyukang commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

seems perf is not affected, maybe r? @estebank

@Kivooeo

Kivooeo commented Sep 15, 2026

Copy link
Copy Markdown
Member

btw, when you write not resolve #N, github will count this as resolve #N and will close #N eventually

@chenyukang

Copy link
Copy Markdown
Member Author

btw, when you write not resolve #N, github will count this as resolve #N and will close #N eventually

Thanks for the reminding!
Fixed it.

(err, candidates)
}

/// Captures only accept identifiers, so put the suggested expression in a named argument.

@estebank estebank Sep 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An example of the resulting rendered suggestion in the method can be useful when skimming.

View changes since the review

@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 10874a5 has been approved by estebank

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Sep 15, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #161873 (move bug and span_bug macros to rustc_span)
 - #162584 (Use File::*lock*() in rustc_data_structures::flock when possible)
 - #162704 (Parser: Uninterpolate when checking for const closures, try bikeshed blocks & in relevant diagnostic code)
 - #162787 (Fix suggestions for names captured by formatting macros)
 - #159562 (Windows: cache the stdio write mode for the duration of a lock session)
 - #162813 (Pre lint port cleanups)
 - #162822 (PassWrapper: adapt for removal of EABIVersion arg in LLVM 24)
@rust-bors
rust-bors Bot merged commit 2cb8b18 into rust-lang:main Sep 16, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 16, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
Rollup merge of #162787 - chenyukang:yukang-fix-105520-format-captured-fields, r=estebank

Fix suggestions for names captured by formatting macros

Fixes #105520

also improve #141136.
but still can not handle #96999.

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

bad diagnostic suggestion for self access in a format string

6 participants