Skip to content

Revert doc attribute parsing errors to future warnings#151952

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
GuillaumeGomez:revert-error-to-future-warning
Feb 4, 2026
Merged

Revert doc attribute parsing errors to future warnings#151952
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
GuillaumeGomez:revert-error-to-future-warning

Conversation

@GuillaumeGomez
Copy link
Member

Part of #151865 (hopefully fixes it).

r? @JonathanBrouwer

@rustbot
Copy link
Collaborator

rustbot commented Feb 1, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 1, 2026
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the revert-error-to-future-warning branch from 746bbbd to 5e7c152 Compare February 1, 2026 21:10
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

Ah, so it's still flaky.

@JonathanBrouwer JonathanBrouwer added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 2, 2026
@JonathanBrouwer
Copy link
Contributor

@rustbot author

@rustbot rustbot 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 Feb 2, 2026
@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Feb 2, 2026

I think there are a few options then

  1. Revert the doc attribute port (This is a lot of work and would make me very sad, also would be way too large of a diff for a beta backport)
  2. Specifically for the new error cases, introduce a second lint that is warn-by-default. Having a second lint group specifically for this is ugly.
  3. Make INVALID_DOC_ATTRIBUTES warn-by-default (current impl), sad that we're regressing all the other cases of this lint from erroring to warning.
  4. Accept that we are making a breaking change, possible with a T-rustdoc FCP. This would be the best long-term option but I'm not sure waiting for this FCP is a good idea because of the beta-backport time constraints.

My proposal would be merge #3 into nightly, backport it, then on nightly do #4

@notriddle
Copy link
Contributor

notriddle commented Feb 2, 2026

I’m confused.

Why is modifying a lint a problem? Isn’t cap-lints supposed to solve this, even for deny-by-default lints?

@JonathanBrouwer
Copy link
Contributor

JonathanBrouwer commented Feb 2, 2026

I was not aware of that option, that makes life slightly better. However, a new deny-by-default lint does still break users, as they need to fix the problem or set cap-lints.

These cases will immediately go from being silently ignored to deny-by-default linted, meaning users don't get time to fix the problem

If I'm wrong and the consensus is that what I'm describing is considered acceptable breakage, lmk

@notriddle
Copy link
Contributor

The important part is that Cargo sets cap-lints=allow by default for your dependencies. This means you only get an error if a crate in your own workspace triggers it, and, if it does, you can immediately fix it by slapping #[allow(invalid_doc_attributes)] on the crate root.

@JonathanBrouwer
Copy link
Contributor

Ah I see, in that case I think making the lint deny by default is reasonably acceptable user breakage. Thanks for explaining!

Copy link
Contributor

@JonathanBrouwer JonathanBrouwer left a comment

Choose a reason for hiding this comment

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

r=me after #151944 merged & this pr is rebased on that

View changes since this review

@GuillaumeGomez GuillaumeGomez force-pushed the revert-error-to-future-warning branch from 5e7c152 to c910511 Compare February 4, 2026 09:54
@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 2026

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.

@GuillaumeGomez
Copy link
Member Author

@bors r=JonathanBrouwer rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 4, 2026

📌 Commit c910511 has been approved by JonathanBrouwer

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 4, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 4, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #150992 (link modifier `export-symbols`: export all global symbols from selected uptream c static libraries)
 - #151534 (target: fix destabilising target-spec-json)
 - #152088 (rustbook/README.md: add missing `)`)
 - #151526 (Fix autodiff codegen tests)
 - #151810 (citool: report debuginfo test statistics)
 - #151952 (Revert doc attribute parsing errors to future warnings)
 - #152065 (Convert to inline diagnostics in `rustc_ty_utils`)
 - #152066 (Convert to inline diagnostics in `rustc_session`)
 - #152069 (Convert to inline diagnostics in `rustc_privacy`)
 - #152072 (Convert to inline diagnostics in `rustc_monomorphize`)
 - #152083 (Fix set_times_nofollow for directory on windows)
 - #152102 (Convert to inline diagnostics in all codegen backends)

Failed merges:

 - #152068 (Convert to inline diagnostics in `rustc_resolve`)
 - #152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)
@rust-bors rust-bors bot merged commit 76a49ee into rust-lang:main Feb 4, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 4, 2026
rust-timer added a commit that referenced this pull request Feb 4, 2026
Rollup merge of #151952 - GuillaumeGomez:revert-error-to-future-warning, r=JonathanBrouwer

Revert doc attribute parsing errors to future warnings

Part of #151865 (hopefully fixes it).

r? @JonathanBrouwer
@GuillaumeGomez GuillaumeGomez deleted the revert-error-to-future-warning branch February 4, 2026 17:14
@GuillaumeGomez GuillaumeGomez restored the revert-error-to-future-warning branch February 4, 2026 17:14
@GuillaumeGomez GuillaumeGomez deleted the revert-error-to-future-warning branch February 4, 2026 17:14
@apiraino
Copy link
Contributor

apiraino commented Feb 5, 2026

Beta backport accepted 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 handled by them.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) beta-accepted Accepted for backporting to the compiler in the beta channel. beta-nominated Nominated 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants