Repository navigation
apply -Zcrate-attr attributes before the crate attributes - #165482
Merged
Merged
Conversation
Contributor
Author
|
i know about #165429 adding edition and file/line/column tests in the same directory (the pr didnt exist when i started working on mine). once it lands ill drop my |
This comment has been minimized.
This comment has been minimized.
Albab-Hasan
force-pushed
the
crate-attr-tests
branch
from
November 5, 2026 14:41
2bc0aed to
619a443
Compare
This comment has been minimized.
This comment has been minimized.
oli-obk
requested changes
Nov 6, 2026
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
rfc 3791 says crate attributes from the command line apply before the attributes in the crate root. ordering-cli checks that several -Zcrate-attr flags apply in command line order. ordering-source records the current behaviour where the command line deny overrides the source warn, which is the wrong way round.
cmdline attributes were pushed after the attributes parsed from source, so a -Zcrate-attr lint level overrode the same lint set in the crate root. rfc 3791 says they apply before the source attributes. they are now inserted at the front of the crate attributes in command line order.
Albab-Hasan
force-pushed
the
crate-attr-tests
branch
from
November 7, 2026 06:17
619a443 to
851c9e0
Compare
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. |
Contributor
Author
|
@rustbot ready |
oli-obk
approved these changes
Nov 7, 2026
Contributor
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 7, 2026
…i-obk apply `-Zcrate-attr` attributes before the crate attributes part of rust-lang#138287. `-Zcrate-attr` attributes were appended after the source crate attrs so `-Zcrate-attr=deny(unused)` overrode a source `#![warn(unused)]`. rfc 3791 says they apply first. this inserts them at the front in command line order and adds two ordering tests. the edition and position tests landed separately in rust-lang#165429 so i dropped mine. r? oli-obk
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 7, 2026
Rollup of 5 pull requests Successful merges: - #164784 (Introduce OptimizationObjective and fix the entry shim's size attributes) - #147696 (Implement `bit` and `set_bit` for integral types.) - #163202 (nuttx: use updated pollfd definition) - #163571 ([rustdoc] Render `Deref` methods on aliased items) - #165482 (apply `-Zcrate-attr` attributes before the crate attributes)
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 7, 2026
…i-obk apply `-Zcrate-attr` attributes before the crate attributes part of rust-lang#138287. `-Zcrate-attr` attributes were appended after the source crate attrs so `-Zcrate-attr=deny(unused)` overrode a source `#![warn(unused)]`. rfc 3791 says they apply first. this inserts them at the front in command line order and adds two ordering tests. the edition and position tests landed separately in rust-lang#165429 so i dropped mine. r? oli-obk
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 7, 2026
…uwer Rollup of 8 pull requests Successful merges: - #164784 (Introduce OptimizationObjective and fix the entry shim's size attributes) - #165469 (Make notable trait `i` badges `<span>` instead of `<a>`) - #165576 (compiletest: Reject whitespace between `//` & `@` and reject leading revision conditions like (e.g., `//[rev]@ dir`)) - #147696 (Implement `bit` and `set_bit` for integral types.) - #163202 (nuttx: use updated pollfd definition) - #165482 (apply `-Zcrate-attr` attributes before the crate attributes) - #165517 (Migrate basic block ctors to require Terminator where possible) - #165552 (use lang item instead of name when assembling builtin `Clone::clone` instances)
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 7, 2026
…uwer Rollup of 8 pull requests Successful merges: - #164784 (Introduce OptimizationObjective and fix the entry shim's size attributes) - #165469 (Make notable trait `i` badges `<span>` instead of `<a>`) - #165576 (compiletest: Reject whitespace between `//` & `@` and reject leading revision conditions like (e.g., `//[rev]@ dir`)) - #147696 (Implement `bit` and `set_bit` for integral types.) - #163202 (nuttx: use updated pollfd definition) - #165482 (apply `-Zcrate-attr` attributes before the crate attributes) - #165517 (Migrate basic block ctors to require Terminator where possible) - #165552 (use lang item instead of name when assembling builtin `Clone::clone` instances)
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 7, 2026
Rollup merge of #165482 - Albab-Hasan:crate-attr-tests, r=oli-obk apply `-Zcrate-attr` attributes before the crate attributes part of #138287. `-Zcrate-attr` attributes were appended after the source crate attrs so `-Zcrate-attr=deny(unused)` overrode a source `#![warn(unused)]`. rfc 3791 says they apply first. this inserts them at the front in command line order and adds two ordering tests. the edition and position tests landed separately in #165429 so i dropped mine. r? oli-obk
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.
part of #138287.
-Zcrate-attrattributes were appended after the source crate attrs so-Zcrate-attr=deny(unused)overrode a source#![warn(unused)]. rfc 3791 says they apply first. this inserts them at the front in command line order and adds two ordering tests. the edition and position tests landed separately in #165429 so i dropped mine.r? oli-obk