277 Commits

Author SHA1 Message Date
Stuart Cook
6ad98750e0
Rollup merge of #145660 - jbatez:darwin_objc, r=jdonszelmann,madsmtm,tmandry
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-17 14:56:44 +10:00
Jana Dönszelmann
f56eb06047
merge crate-level into ALLOWED_TARGETS 2025-09-13 22:37:20 -07:00
Jo Bates
1ebf69d1b1 initial implementation of the darwin_objc unstable feature 2025-09-13 16:06:22 -07:00
Jana Dönszelmann
147e97ae68
Rollup merge of #146389 - jdonszelmann:no-std, r=oli-obk
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-13 02:40:44 +02:00
Jana Dönszelmann
dbd3ef1332
fixup no_{core,std} handling code 2025-09-10 11:45:24 -07:00
Matthias Krüger
422c76adae
Rollup merge of #146178 - folkertdev:static-align, 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-10 14:17:38 +02:00
Jana Dönszelmann
0db2eb7734
port #[no_std] to the new attribute parsing infrastructure 2025-09-09 15:16:02 -07:00
Jana Dönszelmann
b262cae857
port #[no_core] to the new attribute parsing infrastructure 2025-09-09 15:16:02 -07:00
Folkert de Vries
cbacd00f10
allow #[rustc_align_static(N)] on statics
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-09 21:54:54 +02:00
Jana Dönszelmann
6087d89004
fixup limit handling code 2025-09-08 15:07:12 -07:00
Jana Dönszelmann
b82171de5f
port #[pattern_complexity_limit] to the new attribute parsing infrastructure 2025-09-08 14:57:28 -07:00
Jana Dönszelmann
5dbe099dd3
port #[type_length_limit] to the new attribute parsing infrastructure 2025-09-08 14:57:28 -07:00
Jana Dönszelmann
a38288bbe0
port #[move_size_limit] to the new attribute parsing infrastructure 2025-09-08 14:57:28 -07:00
Jana Dönszelmann
92f2402096
port #[recursion_limit] to the new attribute parsing infrastructure 2025-09-08 14:57:28 -07:00
Stuart Cook
6f490f7ae1
Rollup merge of #146112 - scrabsha:push-utkysktvulto, r=WaffleLapkin
don't uppercase error messages
2025-09-04 10:01:59 +10:00
Sasha Pourcelot
5c4b61b4b4 don't uppercase error messages
a more general version of https://github.com/rust-lang/rust/pull/146080.

after a bit of hacking in [`fluent.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_fluent_macro/src/fluent.rs), i discovered that i'm not the only one that is bad at following guidelines 😅. this pr lowercases the first letter of all the error messages in the codebase.

(i did not change things that are traditionally uppercased such as _MIR_, _ABI_ or _C_)

i think it's reasonable to run a `@bors try` so all the test suite is checked, as i cannot run some of the tests on my machine. i double checked (and replaced manually) all the old error messages, but better be safe than sorry.

in the future i will try to add a check in `x test tidy` that errors if an error message starts with an uppercase letter.
2025-09-03 15:24:49 +02:00
Nicholas Nethercote
301655eafe Revert introduction of [workspace.dependencies].
This was done in #145740 and #145947. It is causing problems for people
using r-a on anything that uses the rustc-dev rustup package, e.g. Miri,
clippy.

This repository has lots of submodules and subtrees and various
different projects are carved out of pieces of it. It seems like
`[workspace.dependencies]` will just be more trouble than it's worth.
2025-09-02 19:12:54 +10:00
Jonathan Brouwer
fcd6f284a1
Remove incorrect FIXME 2025-08-30 13:44:13 +02:00
Guillaume Gomez
b944a43660
Rollup merge of #145937 - jdonszelmann:doc-hidden-prelude, r=fmease
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-28 21:41:03 +02:00
Jonathan Brouwer
f328709276
Improve error messages around invalid literals in attribute arguments
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-28 20:05:04 +02:00
Stuart Cook
a65ed63b3b
Rollup merge of #143193 - JonathanBrouwer:link_rework, r=jdonszelmann
Port `#[link]` to the new attribute parsing infrastructure

Ports `link` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
2025-08-28 23:10:33 +10:00
Jacob Pratt
64d0d1d668
Rollup merge of #145826 - scrabsha:push-vrpwttmzqwpt, r=jdonszelmann
Use AcceptContext in AttribueParser::check_target
2025-08-27 21:51:53 -04:00
Jonathan Brouwer
e8d08b5416
Port the #[link] attribute to the new parser 2025-08-27 20:25:16 +02:00
Jonathan Brouwer
aab5e0bf1f
Move NativeLibKind from rustc_session to rustc_hir 2025-08-27 20:24:59 +02:00
Jana Dönszelmann
bf6e99d734
add doc-hidden to exports in attribute prelude 2025-08-27 17:40:23 +02:00
Sasha Pourcelot
2736c7461f Use AcceptContext in AttribueParser::check_target 2025-08-27 09:56:20 +02:00
Nicholas Nethercote
777e2d6a2a Add thin-vec to newly added [workspace.dependencies]. 2025-08-27 13:59:32 +10:00
Samuel Tardieu
fbf247dd31
Rollup merge of #145792 - scrabsha:push-umpytyxunpxq, r=jdonszelmann
Use attribute name in message for "outer attr used as inner attr" errors
2025-08-26 23:25:02 +02:00
Sasha Pourcelot
a8e9ca195e Use attribute name in message for "outer attr used as inner attr" errors 2025-08-25 21:31:04 +02:00
Jonathan Brouwer
3851e6c7b6
Warn on macro calls for attributes that had this behaviour previously 2025-08-24 14:29:03 +02:00
Jana Dönszelmann
48a4e2d2dd
fix ICE on stable related to attrs on macros 2025-08-24 09:20:57 +02:00
Jana Dönszelmann
59ceb02d65
Port crate name to the new attribute system 2025-08-24 09:20:57 +02:00
Jana Dönszelmann
4b35cde904
Support lints in early attribute parsing 2025-08-24 09:14:49 +02:00
Jana Dönszelmann
3bf6144461
Allow errors to be emitted as fatal during attribute parsing 2025-08-24 09:14:49 +02:00
Jana Dönszelmann
1c03ae19db
port attribute to the new parsing infrastructure 2025-08-23 12:31:07 +02:00
Jacob Pratt
87f49e4434
Rollup merge of #145762 - jdonszelmann:attrs-strings-to-symbols, r=lqd
convert strings to symbols in attr diagnostics

r? `@lcnr`

As you rightfully noticed in https://github.com/rust-lang/rust/pull/145670
2025-08-22 22:01:01 -04:00
Jacob Pratt
45d5109ad8
Rollup merge of #145573 - veluca93:unsafe-force-target-feature, r=davidtwco
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-22 22:00:51 -04:00
Jana Dönszelmann
f6ac728aad
convert strings to symbols in attr diagnostics 2025-08-22 22:30:00 +02:00
Jonathan Brouwer
17e34f6b24
Use the new attribute parser throughout the codebase 2025-08-22 08:58:45 +02:00
Jonathan Brouwer
549314bdb7
Rewrite the new attribute parser 2025-08-22 08:38:37 +02:00
Jonathan Brouwer
21d3189779
Move validate_attr to rustc_attr_parsing 2025-08-22 08:37:19 +02:00
Luca Versari
291da71b2a 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-22 01:26:26 +02:00
Jana Dönszelmann
becefdda36
split up context.rs 2025-08-21 13:15:30 +02:00
Jana Dönszelmann
9da854115f
Introduce a prelude for very common imports across dozens of files 2025-08-21 13:15:30 +02:00
Jana Dönszelmann
2158e2d4d7
refactor target checking, move out of context.rs and rename MaybeWarn to Policy 2025-08-21 13:15:30 +02:00
bors
f605b57042 Auto merge of #145601 - jieyouxu:rollup-t5mbqhc, r=jieyouxu
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-19 23:52:06 +00:00
许杰友 Jieyou Xu (Joe)
95615916b1
Rollup merge of #145556 - JonathanBrouwer:extern-crate-stable, r=jdonszelmann
Allow stability attributes on extern crates

Fixes https://github.com/rust-lang/rust/issues/145497

r? ``@jdonszelmann``
2025-08-19 19:50:03 +08:00
许杰友 Jieyou Xu (Joe)
758866d48b
Rollup merge of #145500 - JonathanBrouwer:must_use_target, r=jdonszelmann
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-19 19:45:36 +08:00
Jonathan Brouwer
c1c204d707
Port must_use to the new target checking 2025-08-19 09:03:50 +02:00
Jonathan Brouwer
f0addd040a
Make tool-only suggestion to remove attributes on invalid targets 2025-08-19 09:03:07 +02:00