26 Commits

Author SHA1 Message Date
Alona Enraght-Moony
a33e084afe rustdoc-json: Move #[macro_export] from Other to it's own variant 2025-07-30 19:57:32 +00:00
Alona Enraght-Moony
1a515e6949 rustdoc-json: Add test for #[macro_use] attribute 2025-07-30 19:54:23 +00:00
Alona Enraght-Moony
078332fdc8 rustdoc-json: Structured attributes
Implements https://www.github.com/rust-lang/rust/issues/141358.

This has 2 primary benefits:

1. For rustdoc-json consumers, they no longer need to parse strings of
   attributes, but it's there in a structured and normalized way.
2. For rustc contributors, the output of HIR pretty printing is no
   longer a versioned thing in the output. People can work on
   https://github.com/rust-lang/rust/issues/131229 without needing to
   bump `FORMAT_VERSION`.

(Over time, as the attribute refractor continues, I expect we'll add new
things to `rustdoc_json_types::Attribute`. But this can be done
separately to the rustc changes).
2025-07-15 16:52:41 +00:00
bors
7e310f4b9a Auto merge of #143617 - aDotInTheVoid:devdesktoptestattr, r=Mark-Simulacrum
Run `tests/rustdoc-json/attrs/target_features` on all hosts.

Makes it more convenient to test rustdoc on non x86_64. I mainly care about the aarch64 dev-desktops.

This works because rustdoc uses all target features, not just that of the target.
2025-07-13 12:28:47 +00:00
Fluid
ed96f00682 fix typos in function names in the target_feature test 2025-07-11 02:27:39 +03:00
Predrag Gruevski
717041232a Don't mark #[target_feature] safe fns as unsafe in rustdoc JSON. 2025-07-08 02:02:56 +00:00
Alona Enraght-Moony
45053e21b2 Run tests/rustdoc-json/attrs/target_features on all hosts.
Makes it more convenient to test rustdoc on non x86_64. I mainly care
about the aarch64 dev-desktops.

This works because rustdoc uses all target features, not just that of
the target.
2025-07-07 21:56:54 +00:00
Jonathan Brouwer
3d5d72b761
Port #[target_feature] to the new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-03 07:54:19 +02:00
Anne Stijns
54cec0cf5a Port #[link_section] to the new attribute parsing infrastructure 2025-06-29 16:23:46 +02:00
Guillaume Gomez
0512c82cfa
Rollup merge of #142919 - aDotInTheVoid:cold-cold-attr-for-you, r=GuillaumeGomez
rustdoc-json: Add test for `#[cold]`

Follow-up to https://github.com/rust-lang/rust/pull/142491

r? `@GuillaumeGomez`

CC `@jdonszelmann`
2025-06-24 15:39:41 +02:00
Alona Enraght-Moony
98fce2546d rustdoc-json: Add test for #[cold]
Follow-up to https://www.github.com/rust-lang/rust/pull/142491
2025-06-23 21:34:17 +00:00
Alona Enraght-Moony
bec2679e4e rustdoc-json: Add test for #[optimize(..)]
Follow up to https://www.github.com/rust-lang/rust/pull/138291
2025-06-23 17:23:20 +00:00
Jonathan Brouwer
b24df42488
Port #[must_use] to new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-22 14:51:58 +02:00
Jana Dönszelmann
780b902111
fix clippy 2025-06-17 23:22:51 +02:00
León Orell Valerian Liehr
98bd1a6a3a
rustdoc JSON: Don't apply #[repr] privacy heuristics 2025-05-22 21:26:48 +02:00
Alona Enraght-Moony
8cdfabd230 rustdoc-json: Remove false docs and add test for inline attribute
The docs about how `#[inline]` was represented isn't true. Updates the
comment, and adds a test.

CC https://www.github.com/rust-lang/rust/issues/137645
2025-05-21 19:47:41 +00:00
Alona Enraght-Moony
aeb70c710a rustdoc-json: Remove newlines from attributes 2025-05-07 18:45:58 +00:00
Nicholas Nethercote
e1a177bbba Improve hir pretty-printing of attributes. 2025-05-03 12:46:48 +10:00
Alona Enraght-Moony
7feac15ca7 rustdoc-json: Add test for #[automatically_derived] attribute 2025-03-31 20:42:49 +00:00
Predrag Gruevski
bafdbcadd5 rustdoc: Use own logic to print #[repr(..)] attributes in JSON output. 2025-03-22 18:47:12 +00:00
Alona Enraght-Moony
7ab71c417b tests/rustdoc-json: replace $.index[*][? with $.index[?
Done automatically with VSCode.
2025-03-21 00:48:09 +00:00
Matthias Krüger
bf98654e6c
Rollup merge of #138569 - aDotInTheVoid:reprdoc-json, r=GuillaumeGomez
rustdoc-json: Add tests for `#[repr(...)]`

Works towards #137645 and #81359

Based on #138018, but with only the test changes. CC ```@obi1kenobi```

r? ```@GuillaumeGomez```
2025-03-18 10:09:30 +01:00
Alona Enraght-Moony
677489fb3e rustdoc-json: Don't also include #[deprecated] in Item::attrs 2025-03-16 21:27:54 +00:00
Alona Enraght-Moony
2ff28159d3 rustdoc-json: Add tests for #[deprecated(...)] 2025-03-16 21:09:46 +00:00
Alona Enraght-Moony
f5ecb74bf9 rustdoc-json: Add tests for #[repr(...)]
Co-authored-by: Predrag Gruevski <obi1kenobi82@gmail.com>
2025-03-16 20:28:17 +00:00
Predrag Gruevski
e07d9a8200 rustdoc: Add attribute-related tests for rustdoc JSON. 2025-03-05 04:46:14 +00:00