Skip to content

Reject dangling attributes in where clauses#155078

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
cijiugechu:fix/where-clause-trailing-attrs
Apr 10, 2026
Merged

Reject dangling attributes in where clauses#155078
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
cijiugechu:fix/where-clause-trailing-attrs

Conversation

@cijiugechu
Copy link
Copy Markdown
Contributor

@cijiugechu cijiugechu commented Apr 10, 2026

Report attribute without where predicates for trailing outer attributes in where clauses.

Closes #155073 .

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 10, 2026

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

cc @fmease

@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 10, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 10, 2026

r? @petrochenkov

rustbot has assigned @petrochenkov.
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 69 candidates
  • Random selection from 12 candidates

@petrochenkov
Copy link
Copy Markdown
Contributor

r=me after adding a test case for DocCommentDoesNotDocumentAnything as well.
@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 10, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 10, 2026

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

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 10, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

Could you merge the test cases into the same test file, and squash commits?

@cijiugechu cijiugechu force-pushed the fix/where-clause-trailing-attrs branch from 409a902 to 3c6cf27 Compare April 10, 2026 13:46
@cijiugechu
Copy link
Copy Markdown
Contributor Author

Could you merge the test cases into the same test file, and squash commits?

Done

@cijiugechu
Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot 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 Apr 10, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 10, 2026

📌 Commit 3c6cf27 has been approved by petrochenkov

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 Apr 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 10, 2026
…ng-attrs, r=petrochenkov

Reject dangling attributes in where clauses

Report `attribute without where predicates` for trailing outer attributes in where clauses.

Closes rust-lang#155073 .
rust-bors Bot pushed a commit that referenced this pull request Apr 10, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #152901 (Introduce a `#[diagnostic::on_unknown]` attribute)
 - #155078 (Reject dangling attributes in where clauses)
 - #154449 (Invert dependency between `rustc_errors` and `rustc_abi`.)
 - #154646 (Add suggestion to `.to_owned()` used on `Cow` when borrowing)
 - #154993 (compiletest: pass -Zunstable-options for unpretty and no-codegen paths)
 - #155097 (Make `rustc_attr_parsing::SharedContext::emit_lint` take a `MultiSpan` instead of a `Span`)
@rust-bors rust-bors Bot merged commit c729f33 into rust-lang:main Apr 10, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 10, 2026
rust-timer added a commit that referenced this pull request Apr 10, 2026
Rollup merge of #155078 - cijiugechu:fix/where-clause-trailing-attrs, r=petrochenkov

Reject dangling attributes in where clauses

Report `attribute without where predicates` for trailing outer attributes in where clauses.

Closes #155073 .
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@rust-timer build 3e4669e

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (3e4669e): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never
@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.6% [0.6%, 0.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 8.8%)

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

mean range count
Regressions ❌
(primary)
8.8% [8.8%, 8.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 8.8% [8.8%, 8.8%] 1

Cycles

Results (secondary -4.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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.4% [-6.4%, -2.5%] 6
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.1%, secondary -0.1%)

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)
- - 0
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 24
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 18
All ❌✅ (primary) -0.1% [-0.1%, -0.0%] 24

Bootstrap: 491.232s -> 489.372s (-0.38%)
Artifact size: 394.07 MiB -> 394.10 MiB (0.01%)

github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 13, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#152901 (Introduce a `#[diagnostic::on_unknown]` attribute)
 - rust-lang/rust#155078 (Reject dangling attributes in where clauses)
 - rust-lang/rust#154449 (Invert dependency between `rustc_errors` and `rustc_abi`.)
 - rust-lang/rust#154646 (Add suggestion to `.to_owned()` used on `Cow` when borrowing)
 - rust-lang/rust#154993 (compiletest: pass -Zunstable-options for unpretty and no-codegen paths)
 - rust-lang/rust#155097 (Make `rustc_attr_parsing::SharedContext::emit_lint` take a `MultiSpan` instead of a `Span`)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Apr 16, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#152901 (Introduce a `#[diagnostic::on_unknown]` attribute)
 - rust-lang/rust#155078 (Reject dangling attributes in where clauses)
 - rust-lang/rust#154449 (Invert dependency between `rustc_errors` and `rustc_abi`.)
 - rust-lang/rust#154646 (Add suggestion to `.to_owned()` used on `Cow` when borrowing)
 - rust-lang/rust#154993 (compiletest: pass -Zunstable-options for unpretty and no-codegen paths)
 - rust-lang/rust#155097 (Make `rustc_attr_parsing::SharedContext::emit_lint` take a `MultiSpan` instead of a `Span`)
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.

WCA: We permit outer attributes that don't annotate anything at the end of where clauses

5 participants