Skip to content

Fix string indexing in diagnostic format strings#159470

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mejrs:fix_diagnostic_ice
Jul 18, 2026
Merged

Fix string indexing in diagnostic format strings#159470
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mejrs:fix_diagnostic_ice

Conversation

@mejrs

@mejrs mejrs commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #159252

This also affects beta.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 17, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 17, 2026
@rustbot

rustbot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

r? @ShoyuVanilla

rustbot has assigned @ShoyuVanilla.
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 74 candidates
  • Random selection from 17 candidates

@mejrs mejrs added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 17, 2026

@jieyouxu jieyouxu 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
? me @bors r+ rollup

View changes since this review

@rust-bors

rust-bors Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit d61c706 has been approved by jieyouxu

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 Jul 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 18, 2026
Fix string indexing in diagnostic format strings

Fixes rust-lang#159252

This also affects beta.
rust-bors Bot pushed a commit that referenced this pull request Jul 18, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #159189 (Account for type alias projections in E0308 "expected/found" shortening logic)
 - #158545 (Move `std::io::read_to_string` to `alloc::io`)
 - #159328 (tests/assembly-llvm: pin frame pointer in issue-141649 aarch64 test)
 - #159470 (Fix string indexing in diagnostic format strings)
 - #159500 (Move compiletest CLI parsing to `cli.rs`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 18, 2026
Fix string indexing in diagnostic format strings

Fixes rust-lang#159252

This also affects beta.
rust-bors Bot pushed a commit that referenced this pull request Jul 18, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #159467 (Add explicit `Iterator::count` impl for `str::EncodeUtf16`)
 - #158545 (Move `std::io::read_to_string` to `alloc::io`)
 - #159328 (tests/assembly-llvm: pin frame pointer in issue-141649 aarch64 test)
 - #159470 (Fix string indexing in diagnostic format strings)
 - #159500 (Move compiletest CLI parsing to `cli.rs`)
rust-bors Bot pushed a commit that referenced this pull request Jul 18, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159425 (Windows: add context when opening NUL for child stdio fails)
 - #159467 (Add explicit `Iterator::count` impl for `str::EncodeUtf16`)
 - #157860 (Move rustdoc run-make tests into new `tests/run-make/rustdoc/`)
 - #158545 (Move `std::io::read_to_string` to `alloc::io`)
 - #159328 (tests/assembly-llvm: pin frame pointer in issue-141649 aarch64 test)
 - #159459 (Detect when trait bound requires closure to return itself)
 - #159470 (Fix string indexing in diagnostic format strings)
 - #159500 (Move compiletest CLI parsing to `cli.rs`)
@rust-bors
rust-bors Bot merged commit d711a09 into rust-lang:main Jul 18, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 18, 2026
rust-timer added a commit that referenced this pull request Jul 18, 2026
Rollup merge of #159470 - mejrs:fix_diagnostic_ice, r=jieyouxu

Fix string indexing in diagnostic format strings

Fixes #159252

This also affects beta.
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jul 20, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#159425 (Windows: add context when opening NUL for child stdio fails)
 - rust-lang/rust#159467 (Add explicit `Iterator::count` impl for `str::EncodeUtf16`)
 - rust-lang/rust#157860 (Move rustdoc run-make tests into new `tests/run-make/rustdoc/`)
 - rust-lang/rust#158545 (Move `std::io::read_to_string` to `alloc::io`)
 - rust-lang/rust#159328 (tests/assembly-llvm: pin frame pointer in issue-141649 aarch64 test)
 - rust-lang/rust#159459 (Detect when trait bound requires closure to return itself)
 - rust-lang/rust#159470 (Fix string indexing in diagnostic format strings)
 - rust-lang/rust#159500 (Move compiletest CLI parsing to `cli.rs`)
#[diagnostic::on_unimplemented(note = "🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀{:?}")]
//~^ERROR positional arguments are not permitted in diagnostic attributes [malformed_diagnostic_format_literals]
//~|ERROR format specifiers are not permitted in diagnostic attributes [malformed_diagnostic_format_literals]
pub trait ILoveUnicode {}

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.

😄

@rustbot

rustbot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

beta backport approved as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle. Backport labels are handled by them.

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jul 23, 2026
@cuviper cuviper mentioned this pull request Jul 23, 2026
@cuviper cuviper modified the milestones: 1.99.0, 1.98.0 Jul 23, 2026
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 23, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 24, 2026
[beta] backports

- Fix string indexing in diagnostic format strings #159470
- Resolver: Record at least 1 ambiguous trait if main decl is not a trait. #159599
- Set the rustc lib path for unstable-book-gen #159613

r? me
rust-bors Bot pushed a commit that referenced this pull request Jul 25, 2026
[beta] backports

- Fix string indexing in diagnostic format strings #159470
- Resolver: Record at least 1 ambiguous trait if main decl is not a trait. #159599
- Set the rustc lib path for unstable-book-gen #159613

r? me
rust-bors Bot pushed a commit that referenced this pull request Jul 25, 2026
[beta] backports

- Fix string indexing in diagnostic format strings #159470
- Resolver: Record at least 1 ambiguous trait if main decl is not a trait. #159599
- Set the rustc lib path for unstable-book-gen #159613

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

Labels

beta-accepted Accepted for backporting to the compiler in the beta channel. 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.

[ICE]: diagnostic::on_unimplemented start byte index 10 is not a char boundary

6 participants