Skip to content

Remove special case for AllowedTargets::CrateLevel - #150930

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
JonathanBrouwer:crate_level
Jan 11, 2026
Merged

Remove special case for AllowedTargets::CrateLevel#150930
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
JonathanBrouwer:crate_level

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

@rustbotrustbot 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. labels Jan 10, 2026
@jdonszelmann

Copy link
Copy Markdown
Contributor

r=me on green ci

@JonathanBrouwer

Copy link
Copy Markdown
MemberAuthor

@bors r=jdonszelmann rollup

@rust-borsrust-borsBot 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 Jan 10, 2026
@rust-bors

rust-borsBot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

📌 Commit da0dda1 has been approved by jdonszelmann

It is now in the queue for this repository.

Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 11, 2026
Remove special case for `AllowedTargets::CrateLevel`
r? @jdonszelmann
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 11, 2026
Remove special case for `AllowedTargets::CrateLevel`
r? @jdonszelmann
@ZalatharZalathar mentioned this pull request Jan 11, 2026
rust-borsBot added a commit that referenced this pull request Jan 11, 2026
Rollup of 14 pull requests
Successful merges:
- #148941 (stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`))
- #150368 (adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file)
- #150668 (Unix implementation for stdio set/take/replace)
- #150743 (Reword the collect() docs)
- #150776 (Fix the connect_error test on FreeBSD 15+)
- #150781 (Use `rand` crate more idiomatically)
- #150786 (mGCA: Support array expression as direct const arguments)
- #150812 (Bump `diesel` to the most recent commit in `cargotest`)
- #150862 (std: sys: fs: uefi: Implement File::flush)
- #150873 (Reenable GCC CI download)
- #150908 (llvm: Update `reliable_f16` configuration for LLVM22)
- #150918 (std: sys: fs: uefi: Implement File::seek)
- #150922 (Subscribe myself to attr parsing)
- #150930 (Remove special case for `AllowedTargets::CrateLevel`)
r? @ghost
rust-borsBot added a commit that referenced this pull request Jan 11, 2026
Rollup of 14 pull requests
Successful merges:
- #148941 (stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`))
- #150368 (adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file)
- #150668 (Unix implementation for stdio set/take/replace)
- #150743 (Reword the collect() docs)
- #150776 (Fix the connect_error test on FreeBSD 15+)
- #150781 (Use `rand` crate more idiomatically)
- #150812 (Bump `diesel` to the most recent commit in `cargotest`)
- #150862 (std: sys: fs: uefi: Implement File::flush)
- #150873 (Reenable GCC CI download)
- #150908 (llvm: Update `reliable_f16` configuration for LLVM22)
- #150918 (std: sys: fs: uefi: Implement File::seek)
- #150922 (Subscribe myself to attr parsing)
- #150930 (Remove special case for `AllowedTargets::CrateLevel`)
- #150942 (Port `#[rustc_has_incoherent_inherent_impls]` to attribute parser)
Failed merges:
- #150943 (Port `#[must_not_suspend]` to attribute parser)
r? @ghost
@rust-bors
rust-borsBot merged commit c6cf1c3 into rust-lang:mainJan 11, 2026
11 checks passed
@rustbotrustbot added this to the 1.94.0 milestone Jan 11, 2026
rust-timer added a commit that referenced this pull request Jan 11, 2026
Rollup merge of #150930 - crate_level, r=jdonszelmann
Remove special case for `AllowedTargets::CrateLevel`
r? @jdonszelmann
github-actionsBot pushed a commit to rust-lang/miri that referenced this pull request Jan 12, 2026
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#148941 (stabilize `Peekable::next_if_map` (`#![feature(peekable_next_if_map)]`))
- rust-lang/rust#150368 (adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file)
- rust-lang/rust#150668 (Unix implementation for stdio set/take/replace)
- rust-lang/rust#150743 (Reword the collect() docs)
- rust-lang/rust#150776 (Fix the connect_error test on FreeBSD 15+)
- rust-lang/rust#150781 (Use `rand` crate more idiomatically)
- rust-lang/rust#150812 (Bump `diesel` to the most recent commit in `cargotest`)
- rust-lang/rust#150862 (std: sys: fs: uefi: Implement File::flush)
- rust-lang/rust#150873 (Reenable GCC CI download)
- rust-lang/rust#150908 (llvm: Update `reliable_f16` configuration for LLVM22)
- rust-lang/rust#150918 (std: sys: fs: uefi: Implement File::seek)
- rust-lang/rust#150922 (Subscribe myself to attr parsing)
- rust-lang/rust#150930 (Remove special case for `AllowedTargets::CrateLevel`)
- rust-lang/rust#150942 (Port `#[rustc_has_incoherent_inherent_impls]` to attribute parser)
Failed merges:
- rust-lang/rust#150943 (Port `#[must_not_suspend]` to attribute parser)
r? @ghost
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rust-timer build 2bd58ff

cc #150957 (comment) (original perf results)

@rust-timer

This comment has been minimized.

@JonathanBrouwer

Copy link
Copy Markdown
MemberAuthor

Looking at the perf result, could very well be this PR, lets see the results before making any conclusions tho

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (2bd58ff): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.

meanrangecount
Regressions ❌
(primary)
0.1%[0.1%, 0.1%]4
Regressions ❌
(secondary)
0.4%[0.1%, 1.0%]17
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)0.1%[0.1%, 0.1%]4

Max RSS (memory usage)

Results (primary 1.9%, secondary 2.4%)

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

meanrangecount
Regressions ❌
(primary)
1.9%[1.9%, 1.9%]1
Regressions ❌
(secondary)
2.4%[2.0%, 2.8%]2
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)1.9%[1.9%, 1.9%]1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 474.227s -> 472.544s (-0.35%)
Artifact size: 391.32 MiB -> 391.32 MiB (-0.00%)

@rustbotrustbot added the perf-regression Performance regression. label Jan 12, 2026
@JonathanBrouwer

Copy link
Copy Markdown
MemberAuthor

I'll see if I can find the reason, otherwise we can revert

cx: &mut AcceptContext<'_, 'sess, S>,
) {
Self::check_type(matches!(allowed_targets, AllowedTargets::CrateLevel), target, cx);
if allowed_targets.allowed_targets() == &[Target::Crate] {

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I'm guessing the allowed_targets call here

@JonathanBrouwer

JonathanBrouwer commented Jan 12, 2026

Copy link
Copy Markdown
MemberAuthor

Should be fixed in github.com/rust-lang/rust/pull/151015
@rustbot label: +perf-regression-triaged

@rustbotrustbot added the perf-regression-triaged The performance regression has been triaged. label Jan 12, 2026
rust-borsBot pushed a commit that referenced this pull request Jan 13, 2026
…elmann
Fix perf of `check_crate_level` refactor
Fixes the perf of #150930
The problem is that `allowed_targets` allocates a `Vec`
(also moves a comment around to a move useful place)
r? @jdonszelmann
github-actionsBot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Jan 15, 2026
…elmann
Fix perf of `check_crate_level` refactor
Fixes the perf of rust-lang/rust#150930
The problem is that `allowed_targets` allocates a `Vec`
(also moves a comment around to a move useful place)
r? @jdonszelmann
github-actionsBot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jan 20, 2026
…elmann
Fix perf of `check_crate_level` refactor
Fixes the perf of rust-lang/rust#150930
The problem is that `allowed_targets` allocates a `Vec`
(also moves a comment around to a move useful place)
r? @jdonszelmann
ghaaj pushed a commit to ghaaj/polygrammar that referenced this pull request Aug 7, 2026
…elmann
Fix perf of `check_crate_level` refactor
Fixes the perf of rust-lang/rust#150930
The problem is that `allowed_targets` allocates a `Vec`
(also moves a comment around to a move useful place)
r? @jdonszelmann
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)perf-regressionPerformance regression.perf-regression-triagedThe performance regression has been triaged.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

5 participants

@JonathanBrouwer@rustbot@jdonszelmann@Mark-Simulacrum@rust-timer