Guillaume Gomez
2c8a9cccd9
Rollup merge of #140560 - Urgau:test_attr-module-level, r=GuillaumeGomez
...
Allow `#![doc(test(attr(..)))]` everywhere
This PR adds the ability to specify [`#![doc(test(attr(..)))]`](https://doc.rust-lang.org/nightly/rustdoc/write-documentation/the-doc-attribute.html#testattr ) ~~at module level~~ everywhere in addition to allowing it at crate-root.
This is motivated by a recent PR #140323 (by ````@tgross35)```` where we have to duplicate 2 attributes to every single `f16` and `f128` doctests, by allowing `#![doc(test(attr(..)))]` at module level (and everywhere else) we can omit them entirely and just have (in both module):
```rust
#![doc(test(attr(feature(cfg_target_has_reliable_f16_f128))))]
#![doc(test(attr(expect(internal_features))))]
```
Those new attributes are appended to the one found at crate-root or at a previous module. Those "global" attributes are compatible with merged doctests (they already were before).
Given the small addition that this is, I'm proposing to insta-stabilize it, but I can feature-gate it if preferred.
Best reviewed commit by commit.
r? ````@GuillaumeGomez````
2025-06-07 22:22:55 +02:00
..
2024-12-27 19:58:16 +11:00
2025-02-27 13:22:46 +00:00
2025-03-25 17:33:09 +03:00
2025-05-22 20:12:50 +02:00
2024-12-27 19:58:16 +11:00
2025-03-25 17:33:09 +03:00
2025-05-28 10:28:09 -04:00
2025-05-29 21:50:14 +02:00
2025-05-22 20:12:50 +02:00
2025-03-25 17:33:09 +03:00
2024-02-22 16:04:04 +00:00
2024-12-07 21:37:15 +00:00
2024-12-27 19:58:16 +11:00
2024-11-22 11:12:15 -08:00
2024-12-27 19:58:16 +11:00
2024-11-22 11:12:15 -08:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-09-12 13:47:51 -07:00
2024-09-12 13:48:51 -07:00
2023-12-21 10:17:11 +08:00
2023-12-21 10:17:11 +08:00
2025-04-03 18:10:48 +00:00
2024-04-15 21:49:55 +02:00
2024-04-15 21:49:56 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00
2023-03-30 14:55:03 +02:00
2023-11-24 19:15:52 +01:00
2025-06-02 15:37:15 +00:00
2025-06-02 15:37:15 +00:00
2024-02-22 16:04:04 +00:00
2025-02-04 01:05:31 +00:00
2025-02-04 01:05:31 +00:00
2025-04-13 21:48:53 +03:00
2025-04-13 21:48:53 +03:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2025-03-07 17:55:08 +00:00
2024-12-27 19:58:16 +11:00
2024-06-28 08:01:07 +08:00
2024-06-28 08:01:07 +08:00
2024-06-28 08:01:07 +08:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2025-05-29 21:50:14 +02:00
2025-05-29 21:50:14 +02:00
2025-04-03 18:10:48 +00:00
2025-04-03 18:10:48 +00:00
2025-05-26 21:52:21 +02:00
2025-05-29 21:50:14 +02:00
2024-02-29 14:43:43 +01:00
2024-02-29 14:43:43 +01:00
2025-03-25 17:33:09 +03:00
2025-01-29 15:18:14 +01:00
2025-01-29 13:57:27 +01:00
2025-03-27 11:18:43 +01:00
2023-01-11 09:32:08 +00:00
2024-01-13 12:46:58 -05:00
2025-02-12 19:46:07 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-07-12 18:18:30 -07:00
2024-02-22 16:04:04 +00:00
2024-04-15 15:11:49 -07:00
2024-06-03 03:50:15 +02:00
2024-02-22 16:04:04 +00:00
2025-05-04 18:27:45 +03:00
2025-05-04 18:27:45 +03:00
2024-04-15 15:11:49 -07:00
2024-07-12 18:18:30 -07:00
2024-07-12 18:18:30 -07:00
2025-01-24 01:19:50 +00:00
2024-02-22 16:04:04 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-02-20 15:28:59 +00:00
2025-03-25 17:33:09 +03:00
2024-07-04 00:40:04 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-22 16:04:04 +00:00
2024-05-30 22:52:33 +02:00
2024-07-17 21:30:40 +00:00
2025-01-22 09:20:57 -08:00
2025-01-26 21:20:31 +01:00
2023-03-30 14:55:03 +02:00
2023-03-30 14:55:03 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-12-17 13:56:10 +11:00
2024-03-28 11:09:08 +01:00
2025-04-08 23:06:31 +03:00
2024-12-13 18:48:33 +00:00
2025-04-13 21:48:53 +03:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00
2023-01-11 09:32:08 +00:00
2023-03-30 14:55:03 +02:00
2024-07-22 22:51:53 +00:00
2025-04-09 13:04:57 -04:00
2025-04-09 13:04:57 -04:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-03-07 06:27:09 +00:00
2024-03-07 06:27:09 +00:00
2024-02-22 16:04:04 +00:00
2024-09-12 13:47:51 -07:00
2024-09-12 13:47:51 -07:00
2024-09-12 13:48:51 -07:00
2023-02-23 09:00:33 +00:00
2023-11-24 19:15:52 +01:00
2024-09-09 22:35:10 +02:00
2024-09-09 22:35:10 +02:00
2024-05-21 21:21:26 -07:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-09-09 22:35:10 +02:00
2024-04-13 19:32:39 -07:00
2024-12-27 19:58:16 +11:00
2025-01-01 15:58:29 +01:00
2024-12-27 19:58:16 +11:00
2025-03-27 11:18:43 +01:00
2025-03-25 17:33:09 +03:00
2024-08-06 16:56:48 +02:00
2025-03-16 23:37:09 +01:00
2024-12-27 19:58:16 +11:00
2024-06-09 10:34:54 -07:00
2023-01-11 09:32:08 +00:00
2024-10-22 07:37:54 +01:00
2024-02-22 16:04:04 +00:00
2024-11-04 14:46:04 +01:00
2024-11-28 21:22:06 +01:00
2024-11-04 14:46:04 +01:00
2024-11-28 21:22:06 +01:00
2024-02-22 16:04:04 +00:00
2025-03-01 15:14:02 +01:00
2025-04-03 11:08:55 +03:00
2025-03-03 23:09:42 +00:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-11-23 23:31:30 +00:00
2024-11-23 23:31:30 +00:00
2024-11-29 17:23:34 +11:00
2025-05-22 12:31:28 -05:00
2025-03-25 17:33:09 +03:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00