Skip to content

Check if format argument is identifier to avoid error err-emit #140286

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

Merged
merged 3 commits into from
May 4, 2025

Conversation

xizheyin
Copy link
Contributor

Fixes #139104

When argument is not an identifier, it should not be considered a field access. I checked this and if not emit an invalid format string error. I think we could do with a little finer error handling, I'll open an issue to track this down later.

The first commit submits the ui test, the second commits the code and the changes to the test output.

r? compiler

@rustbot rustbot added 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. labels Apr 25, 2025
@xizheyin xizheyin marked this pull request as draft April 25, 2025 10:13
@xizheyin xizheyin marked this pull request as ready for review April 25, 2025 11:34
@xizheyin xizheyin force-pushed the issue-139104 branch 2 times, most recently from e2c6d0f to c63a4ed Compare May 3, 2025 14:35
@lcnr
Copy link
Contributor

lcnr commented May 3, 2025

Thanks 👍

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 3, 2025

📌 Commit 873ca5f has been approved by lcnr

It is now in the queue for this repository.

@bors bors 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 May 3, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request May 4, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang#139675 (Add the AVX10 target features)
 - rust-lang#140286 (Check if format argument is identifier to avoid error err-emit)
 - rust-lang#140456 (Fix test simd/extract-insert-dyn on s390x)
 - rust-lang#140551 (Move some tests out of tests/ui)
 - rust-lang#140588 (Adjust some ui tests re. target-dependent errors)
 - rust-lang#140617 (Report the `unsafe_attr_outside_unsafe` lint at the closest node)
 - rust-lang#140626 (allow `#[rustfmt::skip]` in combination with `#[naked]`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9c949b0 into rust-lang:master May 4, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone May 4, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 4, 2025
Rollup merge of rust-lang#140286 - xizheyin:issue-139104, r=lcnr

Check if format argument is identifier to avoid error err-emit

Fixes rust-lang#139104

When `argument` is not an identifier, it should not be considered a field access. I checked this and if not emit an invalid format string error. I think we could do with a little finer error handling, I'll open an issue to track this down later.

The first commit submits the ui test, the second commits the code and the changes to the test output.

r? compiler
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.

Invalid format string with certain fill characters yields incorrect suggestion
4 participants