Skip to content

suggest hex escapes for C-style escapes - #156376

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
euclio:foreign-escapes
May 18, 2026
Merged

suggest hex escapes for C-style escapes#156376
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
euclio:foreign-escapes

Conversation

@euclio

@euclioeuclio commented May 9, 2026

Copy link
Copy Markdown
Contributor

@rustbot

Copy link
Copy Markdown
Collaborator

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

@rustbotrustbot 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 May 9, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

r? @mu001999

rustbot has assigned @mu001999.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 18 candidates

@rust-log-analyzer

This comment has been minimized.

@asquared31415

Copy link
Copy Markdown
Contributor

I don't think that the "(perhaps transcribing from another language)" part is useful to the diagnostic. It should be clear from context that Rust simply does this differently.

@mu001999mu001999 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Just some nits

View changes since this review

Comment threadcompiler/rustc_parse/src/lexer/unescape_error_reporting.rs Outdated
Comment threadcompiler/rustc_parse/src/lexer/unescape_error_reporting.rs Outdated
Comment threadcompiler/rustc_parse/src/lexer/unescape_error_reporting.rs Outdated
Comment threadcompiler/rustc_parse/src/lexer/unescape_error_reporting.rs Outdated
@mu001999

Copy link
Copy Markdown
Member

@rustbot author

@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 10, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rust-log-analyzer

This comment has been minimized.

@euclio

Copy link
Copy Markdown
ContributorAuthor

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 10, 2026

@mu001999mu001999 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-borsBot commented May 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 08c3cfc has been approved by mu001999

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 11, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 11, 2026
@mu001999

Copy link
Copy Markdown
Member

@bors r-

@rust-borsrust-borsBot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 11, 2026
@rust-bors

rust-borsBot commented May 11, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#156432), which was unapproved.

View changes since this unapproval

@mu001999mu001999 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment threadcompiler/rustc_parse/src/lexer/unescape_error_reporting.rs
Comment threadcompiler/rustc_parse/src/lexer/unescape_error_reporting.rs
Comment threadcompiler/rustc_parse/src/lexer/unescape_error_reporting.rs Outdated
@rustbotrustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 15, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@euclio

Copy link
Copy Markdown
ContributorAuthor

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 16, 2026

@mu001999mu001999 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please check the above comment

@rustbot author

View changes since this review

@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 17, 2026
@euclio

Copy link
Copy Markdown
ContributorAuthor

Whoops, fixed!

@rustbot ready

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 17, 2026
@mu001999

Copy link
Copy Markdown
Member

Thanks!

@bors r+

@rust-bors

rust-borsBot commented May 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e599831 has been approved by mu001999

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 17, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 17, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 17, 2026
This was referenced May 17, 2026
rust-borsBot pushed a commit that referenced this pull request May 17, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- #151742 (Remove redundant information in `rustc_abi::Variants`)
- #151362 (Add interior-mutability suggestion to `static_mut_refs`)
- #156121 (compiler: suggest `.collect()` when `String` is expected and `Iterator` is found)
- #156208 (Emit retags in codegen to support BorrowSanitizer (part 1))
- #156596 (Split `LintExpectationId`s)
- #156607 (ci: Update FreeBSD version to FreeBSD 14)
- #156376 (suggest hex escapes for C-style escapes)
- #156577 (Test EII UI tests with prefer-dynamic)
- #156585 (explicit tail calls: ignore some tests on unsupported LLVM targets)
- #156598 (Avoid rustfix suggestions for macro-expanded unused imports)
- #156616 (rustdoc: add test case for `-Drustdoc::` and `--cap-lints`)
- #156633 (Add regression test for issue #41261)
- #156635 (rename unexpected_try_recover function)
- #156636 (minor `rustc_mir_transform` cleanup)
rust-borsBot pushed a commit that referenced this pull request May 17, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- #151742 (Remove redundant information in `rustc_abi::Variants`)
- #151362 (Add interior-mutability suggestion to `static_mut_refs`)
- #156121 (compiler: suggest `.collect()` when `String` is expected and `Iterator` is found)
- #156208 (Emit retags in codegen to support BorrowSanitizer (part 1))
- #156596 (Split `LintExpectationId`s)
- #156607 (ci: Update FreeBSD version to FreeBSD 14)
- #156376 (suggest hex escapes for C-style escapes)
- #156577 (Test EII UI tests with prefer-dynamic)
- #156585 (explicit tail calls: ignore some tests on unsupported LLVM targets)
- #156598 (Avoid rustfix suggestions for macro-expanded unused imports)
- #156616 (rustdoc: add test case for `-Drustdoc::` and `--cap-lints`)
- #156633 (Add regression test for issue #41261)
- #156635 (rename unexpected_try_recover function)
- #156636 (minor `rustc_mir_transform` cleanup)
@rust-bors
rust-borsBot merged commit 4bb8551 into rust-lang:mainMay 18, 2026
11 checks passed
@rustbotrustbot added this to the 1.97.0 milestone May 18, 2026
rust-timer added a commit that referenced this pull request May 18, 2026
Rollup merge of #156376 - euclio:foreign-escapes, r=mu001999
suggest hex escapes for C-style escapes
Fixes#148884.
github-actionsBot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request May 18, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#151742 (Remove redundant information in `rustc_abi::Variants`)
- rust-lang/rust#151362 (Add interior-mutability suggestion to `static_mut_refs`)
- rust-lang/rust#156121 (compiler: suggest `.collect()` when `String` is expected and `Iterator` is found)
- rust-lang/rust#156208 (Emit retags in codegen to support BorrowSanitizer (part 1))
- rust-lang/rust#156596 (Split `LintExpectationId`s)
- rust-lang/rust#156607 (ci: Update FreeBSD version to FreeBSD 14)
- rust-lang/rust#156376 (suggest hex escapes for C-style escapes)
- rust-lang/rust#156577 (Test EII UI tests with prefer-dynamic)
- rust-lang/rust#156585 (explicit tail calls: ignore some tests on unsupported LLVM targets)
- rust-lang/rust#156598 (Avoid rustfix suggestions for macro-expanded unused imports)
- rust-lang/rust#156616 (rustdoc: add test case for `-Drustdoc::` and `--cap-lints`)
- rust-lang/rust#156633 (Add regression test for issue rust-lang/rust#41261)
- rust-lang/rust#156635 (rename unexpected_try_recover function)
- rust-lang/rust#156636 (minor `rustc_mir_transform` cleanup)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 17, 2026
…uwer
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#151742 (Remove redundant information in `rustc_abi::Variants`)
- rust-lang/rust#151362 (Add interior-mutability suggestion to `static_mut_refs`)
- rust-lang/rust#156121 (compiler: suggest `.collect()` when `String` is expected and `Iterator` is found)
- rust-lang/rust#156208 (Emit retags in codegen to support BorrowSanitizer (part 1))
- rust-lang/rust#156596 (Split `LintExpectationId`s)
- rust-lang/rust#156607 (ci: Update FreeBSD version to FreeBSD 14)
- rust-lang/rust#156376 (suggest hex escapes for C-style escapes)
- rust-lang/rust#156577 (Test EII UI tests with prefer-dynamic)
- rust-lang/rust#156585 (explicit tail calls: ignore some tests on unsupported LLVM targets)
- rust-lang/rust#156598 (Avoid rustfix suggestions for macro-expanded unused imports)
- rust-lang/rust#156616 (rustdoc: add test case for `-Drustdoc::` and `--cap-lints`)
- rust-lang/rust#156633 (Add regression test for issue rust-lang/rust#41261)
- rust-lang/rust#156635 (rename unexpected_try_recover function)
- rust-lang/rust#156636 (minor `rustc_mir_transform` cleanup)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Diagnostics should recognize string/char escape sequences from C and suggest appropriate Rust equivalents

5 participants

@euclio@rustbot@rust-log-analyzer@asquared31415@mu001999