Rollup of 5 pull requests#156095
Closed
JonathanBrouwer wants to merge 16 commits intorust-lang:mainfrom
Closed
Conversation
…enyukang Validate source snippet when format input is raw string Fixes rust-lang#114865 The issue occurred because the user's proc macro respanned the format arg to an unrelated multi-byte string and we ICE'd by landing in the middle of a multi-byte char. This PR adds validation that prevents the parser from trying to walk such obviously wrong snippets. Such validation already existed for non-raw strings. This PR adds it for raw strings as well.
refactor rustc_on_unimplemented's filtering
Previously when you had a
```rust
pub struct Directive {
pub is_rustc_attr: bool,
pub condition: Option<OnUnimplementedCondition>,
pub subcommands: ThinVec<Directive>,
pub message: Option<(Span, FormatString)>,
...
}
```
that condition would control the emission of the message, label, notes etc. I've changed that to
```rust
pub struct Directive {
pub is_rustc_attr: bool,
pub filters: ThinVec<(Filter, Directive)>,
pub message: Option<(Span, FormatString)>,
...
```
so that the message etc is always emitted, and there's a vec of tuples with (filter, directive) where the filter controls whether that directive is even emitted, which i think is much clearer. That also makes it easier to not have to do the reverse iteration thing and this makes it so that notes are emitted in declaration order (with nonfiltered options always last).
The rename is because I plan on making it available to other diagnostic attributes at some point (very wip) so `OnUnimplementedCondition` and the like would have to be renamed anyway.
Remove unused spans from AttributeKind Recently I noticed some spans in diagnostic attributes were never used. I went through and checked the other variants too.
Move and rename the `clone-never.rs` test
change field `tools` on `AttributeParser` to hold `&'tcx RegisteredTools` Makes tools actually stored, and not just tool names this was originally part of rust-lang#155691 but was split out to make that PR smaller. r? @petrochenkov cc @JonathanBrouwer
Contributor
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 2, 2026
Rollup of 5 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 3, 2026
…uwer Rollup of 5 pull requests Successful merges: - #152277 (Validate source snippet when format input is raw string) - #155940 (refactor rustc_on_unimplemented's filtering) - #156065 (Remove unused spans from AttributeKind) - #156079 (Move and rename the `clone-never.rs` test) - #156091 (change field `tools` on `AttributeParser` to hold `&'tcx RegisteredTools`)
Contributor
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 6912d18 failed: CI. Failed job:
|
Member
|
presumably spurious, but closing as one of the 5 is being tested now. I'm creating a different n=5 rollup |
Contributor
|
This pull request was unapproved due to being closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
clone-never.rstest #156079 (Move and rename theclone-never.rstest)toolsonAttributeParserto hold&'tcx RegisteredTools#156091 (change fieldtoolsonAttributeParserto hold&'tcx RegisteredTools)r? @ghost
Create a similar rollup