about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/attributes
AgeCommit message (Collapse)AuthorLines
2025-10-02Auto merge of #147231 - CrooseGit:dev/reucru01/extend_rustc_force_inline, ↵bors-1/+5
r=saethlin Extending `#[rustc_force_inline]` to be applicable to inherent methods `#[rustc_force_inline]` is an internal-only attribute similar to `#[inline(always)]` but which emits an error if inlining cannot occur. rustc_force_inline uses the MIR inliner to do this and has limitations on where it can be applied to ensure that an error is always emitted if inlining can't happen (e.g. it can't be applied to trait methods because calls to those can't always be resolved). `#[rustc_force_inline]` is motivated by AArch64 pointer authentication intrinsics where it is vital for the security properties of these intrinsics that they do not exist in standalone functions that could be used as gadgets in an exploit (if they could, then you could sign whatever pointers you want, for example, which is bad, but if you force inlining, then you can't jump to a reusable function containing only these instructions). Since its initial implementation, `#[rustc_force_inline]` could only be applied to free functions. This can be relaxed to also allow inherent methods while still preserving the desired properties. In a work-in-progress patch for manual pointer authentication intrinsics, it is useful to introduce types with inherent methods that would need to be force inlined. r? `@saethlin`
2025-10-02Extends `rustc_force_inline` to inherent methodsReuben Cruise-1/+5
- Changes parser to allow application to inherent methods. - Adds tests to confirm extended functionality works just as the existing.
2025-09-26Rollup merge of #146704 - jdonszelmann:port-debug-visualizer, r=petrochenkovMatthias Krüger-0/+61
port `#[debugger_visualizer]` to the new attribute system
2025-09-25Rollup merge of #146667 - calebzulawski:simd-mono-lane-limit, r=lcnr,RalfJungStuart Cook-37/+54
Add an attribute to check the number of lanes in a SIMD vector after monomorphization Allows std::simd to drop the `LaneCount<N>: SupportedLaneCount` trait and maintain good error messages. Also, extends rust-lang/rust#145967 by including spans in layout errors for all ADTs. r? ``@RalfJung`` cc ``@workingjubilee`` ``@programmerjake``
2025-09-23Add an attribute to check the number of lanes in a SIMD vector after ↵Caleb Zulawski-37/+54
monomorphization Unify zero-length and oversized SIMD errors
2025-09-21port `#[debugger_visualizer]` to the new attribute systemJana Dönszelmann-0/+61
2025-09-21Port #[macro_export] to the new attribute parsing infrastructureJonathan Brouwer-0/+63
Co-authored-by: Anne Stijns <anstijns@gmail.com>
2025-09-17port `#[rustc_coherence_is_core]` to the new attribute parsing infrastructureJana Dönszelmann-8/+9
2025-09-17Rollup merge of #145660 - jbatez:darwin_objc, r=jdonszelmann,madsmtm,tmandryStuart Cook-1/+68
initial implementation of the darwin_objc unstable feature Tracking issue: https://github.com/rust-lang/rust/issues/145496 This feature makes it possible to reference Objective-C classes and selectors using the same ABI used by native Objective-C on Apple/Darwin platforms. Without it, Rust code interacting with Objective-C must resort to loading classes and selectors using costly string-based lookups at runtime. With it, these references can be loaded efficiently at dynamic load time. r? ```@tmandry``` try-job: `*apple*` try-job: `x86_64-gnu-nopt`
2025-09-13merge crate-level into ALLOWED_TARGETSJana Dönszelmann-55/+10
2025-09-13initial implementation of the darwin_objc unstable featureJo Bates-1/+68
2025-09-13Rollup merge of #146389 - jdonszelmann:no-std, r=oli-obkJana Dönszelmann-0/+24
Convert `no_std` and `no_core` to the new attribute infrastructure r? ```@oli-obk``` Also added a test for these, since we didn't have any and I was kind of surprised new diagnostics didn't break anything hehe
2025-09-10fixup no_{core,std} handling codeJana Dönszelmann-4/+5
2025-09-10Rollup merge of #146178 - folkertdev:static-align, ↵Matthias Krüger-0/+28
r=jdonszelmann,ralfjung,traviscross Implement `#[rustc_align_static(N)]` on `static`s Tracking issue: https://github.com/rust-lang/rust/issues/146177 ```rust #![feature(static_align)] #[rustc_align_static(64)] static SO_ALIGNED: u64 = 0; ``` We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`. r? `@traviscross`
2025-09-09port `#[no_std]` to the new attribute parsing infrastructureJana Dönszelmann-0/+11
2025-09-09port `#[no_core]` to the new attribute parsing infrastructureJana Dönszelmann-0/+12
2025-09-09allow `#[rustc_align_static(N)]` on `static`sFolkert de Vries-0/+28
We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`.
2025-09-08fixup limit handling codeJana Dönszelmann-18/+19
2025-09-08port `#[pattern_complexity_limit]` to the new attribute parsing infrastructureJana Dönszelmann-0/+27
2025-09-08port `#[type_length_limit]` to the new attribute parsing infrastructureJana Dönszelmann-0/+27
2025-09-08port `#[move_size_limit]` to the new attribute parsing infrastructureJana Dönszelmann-0/+26
2025-09-08port `#[recursion_limit]` to the new attribute parsing infrastructureJana Dönszelmann-2/+62
2025-08-30Remove incorrect FIXMEJonathan Brouwer-1/+1
2025-08-28Rollup merge of #145937 - jdonszelmann:doc-hidden-prelude, r=fmeaseGuillaume Gomez-1/+11
add doc-hidden to exports in attribute prelude Seems to fix rust-lang/rust#145870, at least temporarily. The underlying problem of course is still there. r? `@fmease` <img width="653" height="167" alt="image" src="https://github.com/user-attachments/assets/b5a8094c-849e-4328-997d-b772f9aa4088" /> Fixes rust-lang/rust#145870
2025-08-27Port the `#[link]` attribute to the new parserJonathan Brouwer-3/+418
2025-08-27add doc-hidden to exports in attribute preludeJana Dönszelmann-1/+11
2025-08-26Rollup merge of #145792 - scrabsha:push-umpytyxunpxq, r=jdonszelmannSamuel Tardieu-1/+22
Use attribute name in message for "outer attr used as inner attr" errors
2025-08-25Use attribute name in message for "outer attr used as inner attr" errorsSasha Pourcelot-1/+22
2025-08-24Warn on macro calls for attributes that had this behaviour previouslyJonathan Brouwer-9/+19
2025-08-24Port crate name to the new attribute systemJana Dönszelmann-5/+35
2025-08-23port attribute to the new parsing infrastructureJana Dönszelmann-6/+107
2025-08-22Rollup merge of #145762 - jdonszelmann:attrs-strings-to-symbols, r=lqdJacob Pratt-21/+22
convert strings to symbols in attr diagnostics r? `@lcnr` As you rightfully noticed in https://github.com/rust-lang/rust/pull/145670
2025-08-22Rollup merge of #145573 - veluca93:unsafe-force-target-feature, r=davidtwcoJacob Pratt-40/+78
Add an experimental unsafe(force_target_feature) attribute. This uses the feature gate for https://github.com/rust-lang/rust/issues/143352, but is described in https://github.com/rust-lang/rfcs/pull/3820 which is strongly tied to the experiment.
2025-08-22convert strings to symbols in attr diagnosticsJana Dönszelmann-21/+22
2025-08-22Add an experimental unsafe(force_target_feature) attribute.Luca Versari-40/+78
This uses the feature gate for https://github.com/rust-lang/rust/issues/143352, but is described in https://github.com/rust-lang/rfcs/pull/3820 which is strongly tied to the experiment.
2025-08-21split up context.rsJana Dönszelmann-5/+5
2025-08-21Introduce a prelude for very common imports across dozens of filesJana Dönszelmann-216/+70
2025-08-21refactor target checking, move out of context.rs and rename MaybeWarn to PolicyJana Dönszelmann-48/+128
2025-08-19Auto merge of #145601 - jieyouxu:rollup-t5mbqhc, r=jieyouxubors-0/+1
Rollup of 10 pull requests Successful merges: - rust-lang/rust#145538 (bufreader::Buffer::backshift: don't move the uninit bytes) - rust-lang/rust#145542 (triagebot: Don't warn no-mentions on subtree updates) - rust-lang/rust#145549 (Update rust maintainers in openharmony.md) - rust-lang/rust#145550 (Avoid using `()` in `derive(From)` output.) - rust-lang/rust#145556 (Allow stability attributes on extern crates) - rust-lang/rust#145560 (Remove unused `PartialOrd`/`Ord` from bootstrap) - rust-lang/rust#145568 (ignore frontmatters in `TokenStream::new`) - rust-lang/rust#145571 (remove myself from some adhoc-groups and pings) - rust-lang/rust#145576 (Add change tracker entry for `--timings`) - rust-lang/rust#145578 (Add VEXos "linked files" support to `armv7a-vex-v5`) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-19Rollup merge of #145556 - JonathanBrouwer:extern-crate-stable, r=jdonszelmann许杰友 Jieyou Xu (Joe)-0/+1
Allow stability attributes on extern crates Fixes https://github.com/rust-lang/rust/issues/145497 r? ``@jdonszelmann``
2025-08-19Rollup merge of #145500 - JonathanBrouwer:must_use_target, r=jdonszelmann许杰友 Jieyou Xu (Joe)-2/+18
Port must_use to the new target checking This PR ports `must_use` to the new target checking logic This also adds a tool-only suggestion to remove attributes on invalid targets, as to not immediately undo the work of https://github.com/rust-lang/rust/pull/145274 r? `@jdonszelmann`
2025-08-19Port `must_use` to the new target checkingJonathan Brouwer-2/+18
2025-08-19Rollup merge of #145243 - jdonszelmann:inner-attr-errors, r=petrochenkovStuart Cook-8/+8
take attr style into account in diagnostics when the original attribute was specified as an inner attribute, the suggestion will now match that attribute style
2025-08-18Allow stability attributes on extern cratesJonathan Brouwer-0/+1
2025-08-18Rollup merge of #145485 - JonathanBrouwer:fix-deprecation-targets, ↵Stuart Cook-0/+2
r=jdonszelmann Fix deprecation attributes on foreign statics r? ````````@jdonszelmann```````` Fixes https://github.com/rust-lang/rust/issues/145437
2025-08-16take attr style into account in attr diagnosticsJana Dönszelmann-8/+8
2025-08-16Fix deprecation attribute on foreign statics & typesJonathan Brouwer-0/+2
2025-08-15Port `#[custom_mir(..)]` to the new attribute systemSasha Pourcelot-0/+141
2025-08-14Specify the list of allowed targets per attributeJonathan Brouwer-44/+361
2025-08-14Allow attribute parsers to specify a list of allowed targetsJonathan Brouwer-7/+14
Every acceptor gets an `ALLOWED_TARGETS` specification which can specify per target whether it is allowed, warned, or errored.