A Rust compiler front-end for IDEs
Find a file
Guillaume Gomez 7c8ac0f4ef
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
.cargo fix: Fix generated markers not being patchable in package.json 2024-06-08 12:54:43 +02:00
.github Merge pull request #19808 from Veykril/lw-ollszwnlmquw 2025-05-16 15:00:07 +00:00
.vscode feat: use vscode log format for client logs 2024-07-27 21:43:35 -07:00
assets
bench_data chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
crates Account for Generate actions when filtering the allowed ones 2025-05-31 12:29:50 +03:00
docs/book feat: Render padding information when hovering on structs 2025-05-28 14:18:50 +09:00
editors/code feat: Render padding information when hovering on structs 2025-05-28 14:18:50 +09:00
lib fix: Fix new nightly lints 2025-03-31 13:27:54 +02:00
xtask fix: Fix manual not containing diagnostics documentation 2025-05-31 14:36:29 +02:00
.editorconfig fix: do not apply editorconfig to git commit msg 2025-03-08 01:44:27 +05:30
.git-blame-ignore-revs Fix some mir eval/lowerings 2025-02-03 14:42:41 +01:00
.gitattributes Fix .gitattributes for test_data 2022-07-24 14:05:35 +02:00
.gitignore manual: Convert to mdbook 2025-01-24 13:23:22 -08:00
.typos.toml Disable typos checker for the target feature names 2025-02-25 05:02:17 +02:00
Cargo.lock Bump salsa 2025-05-23 12:58:00 +02:00
Cargo.toml Bump salsa 2025-05-23 12:58:00 +02:00
clippy.toml Enforce a current directory being set for spawned commands 2024-12-29 12:51:13 +01:00
CONTRIBUTING.md move dev docs to manual 2025-02-17 10:47:27 -08:00
LICENSE-APACHE Drop Apache license appendices 2024-08-27 14:52:34 +03:00
LICENSE-MIT
PRIVACY.md Update PRIVACY.md 2025-02-07 20:18:21 +01:00
README.md move dev docs to manual 2025-02-17 10:47:27 -08:00
rust-version Preparing for merge from rust-lang/rust 2025-05-20 10:00:23 +03:00
rustfmt.toml Shuffle hir-expand things around 2024-01-26 19:28:39 +01:00
triagebot.toml Enable [canonicalize-issue-links] and [no-mentions] in triagebot 2025-04-09 22:15:51 +02:00

rust-analyzer logo

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

Quick Start

https://rust-analyzer.github.io/book/installation.html

Documentation

If you want to contribute to rust-analyzer check out the CONTRIBUTING.md or if you are just curious about how things work under the hood, see the Contributing section of the manual.

If you want to use rust-analyzer's language server with your editor of choice, check the manual. It also contains some tips & tricks to help you be more productive when using rust-analyzer.

Security and Privacy

See the security and privacy sections of the manual.

Communication

For usage and troubleshooting requests, please use "IDEs and Editors" category of the Rust forum:

https://users.rust-lang.org/c/ide/14

For questions about development and implementation, join rust-analyzer working group on Zulip:

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer

License

rust-analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.