| Age | Commit message (Collapse) | Author | Lines |
|
From `#[align]` -> `#[rustc_align]`. Attributes starting with `rustc`
are always perma-unstable and feature-gated by `feature(rustc_attrs)`.
See regression RUST-143834.
For the underlying problem where even introducing new feature-gated
unstable built-in attributes can break user code such as
```rs
macro_rules! align {
() => {
/* .. */
};
}
pub(crate) use align; // `use` here becomes ambiguous
```
refer to RUST-134963.
Since the `#[align]` attribute is still feature-gated by
`feature(fn_align)`, we can rename it as a mitigation. Note that
`#[rustc_align]` will obviously mean that current unstable user code
using `feature(fn_aling)` will need additionally `feature(rustc_attrs)`,
but this is a short-term mitigation to buy time, and is expected to be
changed to a better name with less collision potential.
See
<https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202025-07-17/near/529290371>
where mitigation options were considered.
(cherry picked from commit 69b71e44107b4905ec7ad84ccb3edf4f14b3df69)
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
|
|
Port `#[may_dangle]` to the new attribute system
Very similar to rust-lang/rust#142498.
This is a part of rust-lang/rust#131229, so
r? `@jdonszelmann`
|
|
Rollup of 9 pull requests
Successful merges:
- rust-lang/rust#142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.)
- rust-lang/rust#142491 (Rework #[cold] attribute parser)
- rust-lang/rust#142494 (Fix missing docs in `rustc_attr_parsing`)
- rust-lang/rust#142495 (Better template for `#[repr]` attributes)
- rust-lang/rust#142497 (Fix random failure when JS code is executed when the whole file was not read yet)
- rust-lang/rust#142575 (Ensure copy* intrinsics also perform the static self-init checks)
- rust-lang/rust#142650 (Refactor Translator)
- rust-lang/rust#142713 (mbe: Refactor transcription)
- rust-lang/rust#142755 (rustdoc: Remove `FormatRenderer::cache`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
remove equivalent new method on context
Noticed the two had converged so much they literally became equivalent. So one could go hehe
|
|
correct template for `#[align]` attribute
Tracking issue: https://github.com/rust-lang/rust/issues/82232
related: https://github.com/rust-lang/rust/pull/142507
I didn't fully understand what `template!` did, clearly. An empty `#[align]` attribute was still rejected later, but without this change it does get suggested in certain cases.
I've also updated some outdated references to `#[repr(align)]` on functions.
r? ``@jdonszelmann``
|
|
Better template for `#[repr]` attributes
|
|
Fix missing docs in `rustc_attr_parsing`
|
|
|
|
|
|
rewrite `optimize` attribute to use new attribute parsing infrastructure
r? ```@oli-obk```
I'm afraid we'll get quite a few of these PRs in the future. If we get a lot of trivial changes I'll start merging multiple into one PR. They should be easy to review :)
Waiting on #138165 first
|
|
|
|
it should not suggest just `#[align]`
|
|
|
|
|
|
|
|
Right now it's used for functions with `fn_align`, in the future it will
get more uses (statics, struct fields, etc.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tracking the old name of renamed unstable library features
This PR resolves the first problem of rust-lang/rust#141617 : tracking renamed unstable features. The first commit is to add a ui test, and the second one tracks the changes. I will comment on the code for clarification.
r? `@jdonszelmann`
There have been a lot of PR's reviewed by you lately, thanks for your time!
cc `@jyn514`
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
|
|
|
|
lint on duplicates during attribute parsing
To do this we stuff them in the diagnostic context to be emitted after
hir is constructed
|
|
|
|
|
|
|
|
|
|
Clean `rustc_attr_parsing/src/lib.rs` documentation
Improves the documentation clarity in `rustc_attr_parsing` by restructuring content with clearer section headers, simplifying explanations of attribute types, making technical descriptions more precise.
r? ``@oli-obk``
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
Streamline some attr parsing APIs
r? ``@jdonszelmann``
|
|
|
|
Simplify `attribute_groups`
It's more complicated than it needs to be.
r? ``@jdonszelmann``
|
|
|
|
And avoid the clone.
|
|
They're equivalent, and `path` is unused, and `deconstruct` has only one
call site outside of `path`.
|
|
They are unused.
|
|
|
|
|
|
|
|
In several files they are entirely unnecessary, with the relevant names
already imported. And in a few I have added the necessary `use` item.
|
|
Some are too long (> 100 chars), some are too short, some are missing
full stops, some are missing upper-case letters at the start of
sentences.
|
|
There only needs to be one `Fn` per symbol, not multiple.
|