Skip to content

Move track_caller on closures gating to attribute parsing - #162075

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mejrs:track_caller_closure_gating
Sep 1, 2026
Merged

Move track_caller on closures gating to attribute parsing#162075
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mejrs:track_caller_closure_gating

Conversation

@mejrs

@mejrs mejrs commented Aug 31, 2026

Copy link
Copy Markdown
Member

I noticed this while reviewing #161958

@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

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. labels Aug 31, 2026
@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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: ast_lowering, compiler
  • ast_lowering, compiler expanded to 75 candidates
  • Random selection from 17 candidates

}
if is_closure
&& !tcx.features().closure_track_caller()
&& !attr_span.allows_unstable(sym::closure_track_caller)

@JonathanBrouwer JonathanBrouwer Aug 31, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does technically make the feature gate slightly stricter, since we were previously checking for attr_span.allows_unstable(sym::closure_track_caller).
I think that's fine though, I'm not expecting anyone to be relying on this, and we can add it back if anyone complains :)

View changes since the review

if self.tcx.features().async_fn_track_caller()
&& let Some(attrs) = self.attrs.get(&outer_hir_id.local_id)
&& find_attr!(*attrs, TrackCaller(_))
&& let Some(t) = attrs.iter().find(|a| {

@JonathanBrouwer JonathanBrouwer Aug 31, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Kinda sad that we need to expand the find_attr! here but this code is so much better than whatever was going on before, so thanks!

View changes since the review

@JonathanBrouwer JonathanBrouwer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e18a012 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 31, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 31, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 31, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 31, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
rust-bors Bot pushed a commit that referenced this pull request Aug 31, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #162045 (`rust-analyzer` subtree update)
 - #162077 (compiler-builtins subtree update)
 - #137720 (support `#[target_feature(enable = ...)]` on `#[naked]` functions)
 - #160534 (stabilize smart pointer map functions)
 - #160551 (mir_build: Clearly distinguish or/refutable/irrefutable patterns during match lowering)
 - #161929 (explicitly track inherent const generic args kind)
 - #162063 (Switch dist-aarch64-linux to EC2 and update dist-x86_64-linux)
 - #161937 (A series of Polonius Alpha refactors)
 - #162014 (Move more `rustdoc-html` tests using `--test` into the right folder)
 - #162051 (`rustc_feature` cleanups)
 - #162055 (remove `_{style}` recovery for diagnostic structs)
 - #162075 (Move track_caller on closures gating to attribute parsing)
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 1, 2026
… r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing rust-lang#161958
rust-bors Bot pushed a commit that referenced this pull request Sep 1, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #137720 (support `#[target_feature(enable = ...)]` on `#[naked]` functions)
 - #160534 (stabilize smart pointer map functions)
 - #160551 (mir_build: Clearly distinguish or/refutable/irrefutable patterns during match lowering)
 - #160989 (Make sin, cos, exp, exp2, log, log2, log10 generic)
 - #161861 (mir_build: Clarify parts of if-condition lowering)
 - #161929 (explicitly track inherent const generic args kind)
 - #162040 (bootstrap: stage0 to cbae9b4)
 - #162063 (Switch dist-aarch64-linux to EC2 and update dist-x86_64-linux)
 - #161353 (Add test for parallel compiler reproducible build)
 - #161937 (A series of Polonius Alpha refactors)
 - #162051 (`rustc_feature` cleanups)
 - #162055 (remove `_{style}` recovery for diagnostic structs)
 - #162075 (Move track_caller on closures gating to attribute parsing)
 - #162079 (std: implement `File::fsync` for Hermit)
 - #162097 (Deduplicate `InstrumentFnAttr`)
 - #162115 (fix typo in feature documentation)
rust-bors Bot pushed a commit that referenced this pull request Sep 1, 2026
Rollup merge of #162075 - mejrs:track_caller_closure_gating, r=JonathanBrouwer

Move track_caller on closures gating to attribute parsing

I noticed this while reviewing #161958
@rust-bors
rust-bors Bot merged commit dbfa398 into rust-lang:main Sep 1, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

4 participants