about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/validate_attr.rs
AgeCommit message (Collapse)AuthorLines
2025-08-22Move validate_attr to `rustc_attr_parsing`Jonathan Brouwer-350/+0
2025-08-11Add link to docs on malformed attributesEsteban Küber-15/+18
2025-08-11Allow attr entries to declare list of alternatives for `List` and ↵Esteban Küber-2/+6
`NamedValueStr` Modify `AttributeTemplate` to support list of alternatives for list and name value attribute styles. Suggestions now provide more correct suggested code: ``` error[E0805]: malformed `used` attribute input --> $DIR/used_with_multi_args.rs:3:1 | LL | #[used(compiler, linker)] | ^^^^^^------------------^ | | | expected a single argument here | help: try changing it to one of the following valid forms of the attribute | LL - #[used(compiler, linker)] LL + #[used(compiler)] | LL - #[used(compiler, linker)] LL + #[used(linker)] | LL - #[used(compiler, linker)] LL + #[used] | ``` instead of the prior "masking" of the lack of this feature by suggesting pipe-separated lists: ``` error[E0805]: malformed `used` attribute input --> $DIR/used_with_multi_args.rs:3:1 | LL | #[used(compiler, linker)] | ^^^^^^------------------^ | | | expected a single argument here | help: try changing it to one of the following valid forms of the attribute | LL - #[used(compiler, linker)] LL + #[used(compiler|linker)] | LL - #[used(compiler, linker)] LL + #[used] | ```
2025-07-31Consider operator's span when computing binop expr spanMichael Goulet-1/+1
2025-07-24Call `is_parsed_attribute` rather than keeping track of a list of parsed ↵Jonathan Brouwer-61/+4
attributes manually
2025-07-24Rollup merge of #144358 - JonathanBrouwer:fix-stability-malformed, r=oli-obkLeón Orell Valerian Liehr-0/+3
Stop using the old `validate_attr` logic for stability attributes I think this was accidentally missed when implementing the stability attributes? r? `````@oli-obk````` cc `````@jdonszelmann`````
2025-07-23Stop using the old `validate_attr` logic for stability attributesJonathan Brouwer-0/+3
2025-07-23Ports `#[macro_use]` and `#[macro_escape]` to the new attribute parsing ↵Jonathan Brouwer-0/+2
infrastructure
2025-07-19Mitigate `#[align]` name resolution ambiguity regression with a renameJieyou Xu-1/+3
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.
2025-07-16Port `#[coverage]` to the new attribute systemSasha Pourcelot-0/+1
2025-07-15Auto merge of #143958 - samueltardieu:rollup-lh1s143, r=samueltardieubors-0/+1
Rollup of 13 pull requests Successful merges: - rust-lang/rust#142301 (tests: Fix duplicated-path-in-error fail with musl) - rust-lang/rust#143630 (Drop `./x suggest`) - rust-lang/rust#143736 (Give all bytes of TypeId provenance) - rust-lang/rust#143752 (Don't panic if WASI_SDK_PATH not set when detecting compiler) - rust-lang/rust#143837 (Adjust `run_make_support::symbols` helpers) - rust-lang/rust#143878 (Port `#[pointee]` to the new attribute parsing infrastructure) - rust-lang/rust#143905 (Recover and suggest to use `;` to construct array type) - rust-lang/rust#143907 (core: make `str::split_at_unchecked()` inline) - rust-lang/rust#143910 (Add experimental `backtrace-trace-only` std feature) - rust-lang/rust#143927 (Preserve constness in trait objects up to hir ty lowering) - rust-lang/rust#143935 (rustc_type_ir/walk: move docstring to `TypeWalker` itself) - rust-lang/rust#143938 (Update books) - rust-lang/rust#143941 (update `cfg_select!` documentation) Failed merges: - rust-lang/rust#143926 (Remove deprecated fields in bootstrap) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-15Define attribute parser & config evaluatorJonathan Brouwer-8/+6
2025-07-14Port `#[pointee]` to the new attribute parsing infrastructureJonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-14Rollup merge of #143855 - JonathanBrouwer:omit_gdb_pretty_printer_section, ↵Samuel Tardieu-0/+1
r=jdonszelmann Port `#[omit_gdb_pretty_printer_section]` to the new attribute parsing Ports `#[omit_gdb_pretty_printer_section]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163 r? ```@jdonszelmann```
2025-07-14Rollup merge of #143217 - Periodic1911:link-ordinal, r=jdonszelmannJakub Beránek-0/+1
Port #[link_ordinal] to the new attribute parsing infrastructure Ports link_ordinal to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
2025-07-13Port `#[link_ordinal]` to the new attribute parsing infrastructure.Anne Stijns-0/+1
2025-07-12Port `#[omit_gdb_pretty_printer_section]` to the new attribute parsing ↵Jonathan Brouwer-0/+1
infrastructure Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-12Port `#[automatically_derived]` to the new attribute parsing infrastructureJonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-09Port `#[rustc_coherence_is_core]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[rustc_allow_incoherent_impl]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[rustc_paren_sugar]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[fundamental]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[marker]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[rustc_unsafe_specialization_marker]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[rustc_specialization_trait]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[type_const]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[rustc_coinductive]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[rustc_do_not_implement_via_object]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[rustc_deny_explicit_impl]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-09Port `#[const_trait]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-07Port `#[rustc_std_internal_symbol]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-07Port `#[ffi_pure]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-07Port `#[ffi_const]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-07Port `#[export_stable]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-06Port `#[path]` to the new attribute parsing infrastructureJonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-06Move check for new attribute to `check_builtin_meta_item`Jonathan Brouwer-36/+35
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-05Port `#[ignore]` to the new attribute parsing infrastructureJonathan Brouwer-2/+2
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-04Port `#[non_exhaustive]` to the new attribute parsing infrastructureJonathan Brouwer-0/+1
2025-07-04Rollup merge of #143400 - GrigorenkoPV:attributes/lints, r=jdonszelmannMatthias Krüger-0/+1
Port `#[rustc_pass_by_value]` to the new attribute system Part of rust-lang/rust#131229 r? `@oli-obk`
2025-07-04Port `#[rustc_pass_by_value]` to the new attribute systemPavel Grigorenko-0/+1
2025-07-03Port `#[no_implicit_prelude]` to the new attribute parsing infrastructureJonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-03Port `#[target_feature]` to the new attribute parsing infrastructureJonathan Brouwer-0/+2
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-01Fix duplicate errors for `link_section`, ↵Jonathan Brouwer-0/+3
`rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end`
2025-07-01Fix `#[rustc_macro_transparency]` giving two errorsJonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-01Fix double error for `export_name`Jonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-28Port `#[link_name]` to the new attribute parsing infrastructureJonathan Brouwer-0/+1
Co-authored-by: Anne Stijns <anstijns@gmail.com> Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-24Rewrite #[track_caller]Jana Dönszelmann-0/+1
2025-06-23Port `#[rustc_skip_during_method_dispatch]` to the new attribute systemPavel Grigorenko-0/+7
2025-06-22Port `#[must_use]` to new attribute parsing infrastructureJonathan Brouwer-0/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-20expected word diagnostic testJana Dönszelmann-0/+1