commit | 0c2fbe53a69ae8e3b0b779fe5e05aacb0edd7143 | [log] [tgz] |
---|---|---|
author | Trevor Gross <t.gross35@gmail.com> | Tue May 27 20:28:30 2025 -0400 |
committer | GitHub <noreply@github.com> | Tue May 27 20:28:30 2025 -0400 |
tree | 719bafffe8ca267e78c166b692b8772f8d01a6db | |
parent | 743d2527a26f3d92f82614f303a5b76c28366109 [diff] | |
parent | 3fd0265fbb236c8309f2f913cf9946e64818f643 [diff] |
Rollup merge of #140894 - Urgau:check-cfg-rustdoc, r=GuillaumeGomez Make check-cfg diagnostics work in `#[doc(cfg(..))]` This PR makes it so that the check-cfg `unexpected_cfgs` lint, is correctly emitted in `rustdoc`'s `#[doc(cfg(..))]`. This is achieved by adding a custom trait to `cfg_matches` (the method that emits the lint) which permits `rustc` and `rustdoc` to each have their way to emitting lints (via buffered lints/AST for `rustc` and via `TyCtxt`/HIR for `rustdoc`). The reason this is required is because buffered lints operates on the AST but `rustdoc` uses the HIR and by the time `rustdoc` calls `cfg_matches` we are way passed the point where buffered lints have been drain and emitted. Best reviewed commit by commit. r? `@jieyouxu` (for the compiler part) r? `@GuillaumeGomez` (for the rustdoc part)
Website | Getting started | Learn | Documentation | Contributing
This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.
Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrated with other languages.
Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.
Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).
Read “Installation” from The Book.
If you really want to install from source (though this is not recommended), see INSTALL.md.
See https://www.rust-lang.org/community for a list of chat platforms and forums.
See CONTRIBUTING.md.
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the “Rust Trademarks”).
If you want to use these names or brands, please read the Rust language trademark policy.
Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.