You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#160211 - jieyouxu:froot-loops, r=mati865
Rename `#[unroll]` => `#[rustc_unroll]` to mitigate nameres ambiguity
## Summary
Mitigate rust-lang#159429 by renaming `#[unroll]` => `#[rustc_unroll]`.
Did not bother with a regression test, because a regression test would be hedging against an unknown attribute if `#[unroll]` later proceeds to get a different name.
Tracking issue for `#![feature(loop_hints)]`: rust-lang#156874.
## Rationale
Even while the crater-observed fallout seems to be relatively small, we'd like such nameres ambiguity breakages to be *deliberate* (read: T-lang FCP'd) rather than accidental (discovered through beta crater runs).
See discussions around [last week's compiler triage meeting](https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202026-07-23/near/612371735).
## Background context
The recurring problem is that built-in attributes are treated differently compared to ordinary prelude attributes, built-in attributes, even while unstable, can name-collide with stable macro re-exports of the same name (and proc-macro helper attributes of the same name), which can break stable code. See rust-lang#134964.
See also:
- rust-lang#133708
- rust-lang#53913 (comment)
- https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Name.20Res.3A.20questions.20on.20intended.20behavior/near/562001319
- rust-lang#143834 (comment)
## Prior Art
- For `#[align]`, breakage was more wide-spread, so we posted this same mitigation here: rust-lang#144080.
- For `#[sanitize]`, T-lang explicitly FCP'd the breakage stemming from renaming `#[no_sanitize]` (old name) to `#[sanitize]` (new name) that regressed a couple of crates: rust-lang#142681 (comment).
## Alternatives to this PR
Generally:
- We let it slide.
- T-lang FCP on `#[unroll]` breakage (in which case this PR should be closed).
- FCP another name (and associated breakages).
- (Hard) Fix the built-in attribute name resolution behavior.
I have no particular preference on the approaches myself, any of this PR and the alternatives seem fine so as long as the breakage is *deliberate* not accidental.
0 commit comments