about summary refs log tree commit diff
path: root/src/tools/lint-docs
AgeCommit message (Collapse)AuthorLines
2025-09-02Revert introduction of `[workspace.dependencies]`.Nicholas Nethercote-2/+2
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-08-30Fix stage 1 compiler testsJakub Beránek-8/+47
2025-08-28Add `tempfile` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1
2025-08-28Add `serde_json` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1
2025-07-17Rollup merge of #143631 - hkBst:update-escaper-2, r=compiler-errorsMatthias Krüger-1/+1
update to literal-escaper-0.0.5 Quoting from the changelog, this version brings: - Use `NonZero<char/u8>` in `unescape_c_str` and `check_raw_c_str` to statically exclude nuls - Add `#[inline]` to small functions for improved performance
2025-07-11Split up the `unknown_or_malformed_diagnostic_attributes` lintmejrs-0/+4
2025-07-08update to literal-escaper-0.0.5Marijn Schouten-1/+1
2025-06-23update to literal-escaper 0.0.4 for better API without `unreachable` and ↵Marijn Schouten-3/+3
faster string parsing
2025-05-27Avoid including text direction codepoints in lint messagesMatthew Jasper-0/+12
2025-05-07Rollup merge of #134273 - RalfJung:de-stabilize-bench, r=ibraheemdev,traviscrossJacob Pratt-0/+1
de-stabilize bench attribute This has been soft-unstable since forever (https://github.com/rust-lang/rust/pull/64066), and shown in future-compat reports since Rust 1.77 (https://github.com/rust-lang/rust/pull/116274). The feature covering `bench` itself is tracked in https://github.com/rust-lang/rust/issues/50297, which has been closed despite still having active feature gates referencing it. Cc `@rust-lang/libs-api`
2025-04-26Update lint-docs to default to Rust 2024Eric Huss-1/+1
This updates the lint-docs tool to default to the 2024 edition. The lint docs are supposed to illustrate the code with the latest edition, and I just forgot to update this in https://github.com/rust-lang/rust/pull/133349. Some docs needed to add the `edition` attribute since they were assuming a particular edition, but were missing the explicit annotation.
2025-04-26lint-docs: Don't hard-code the valid editionsEric Huss-14/+8
This removes the hard-coded list of edition support in the lint-docs tool, and instead just assumes the edition attribute is something valid. There isn't a real reason to have this, as rustc will error if given a wrong number. This should be easier to maintain going forward.
2025-02-08Rustfmtbjorn3-18/+24
2025-01-14Un-spaghettify the control flow of generate_lint_outputMichael Goulet-40/+49
Co-authored-by: Eric Huss <eric@huss.org>
2025-01-13Detect unstable lint docs that dont enable their featureMichael Goulet-10/+28
2024-12-13the soft_unstable lint cannot have an example that will keep workingRalf Jung-0/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-24/+18
2024-09-04forward linker option to lint-docschenx97-0/+13
2024-08-21lint on tail expr drop order change in Edition 2024Ding Xiang Fei-0/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+3
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-17Rename `deprecated_safe` lint to `deprecated_safe_2024`Tobias Bucher-0/+1
Create a lint group `deprecated_safe` that includes `deprecated_safe_2024`. Addresses https://github.com/rust-lang/rust/issues/124866#issuecomment-2142814375.
2024-07-07use "bootstrap" instead of "rustbuild" in comments and docsonur-ozkan-2/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-13lint-docs: apply considerable clippy suggestionsonur-ozkan-10/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-24Add "better" edition handling on lint-docs toolSantiago Pastorino-2/+11
2024-04-22Deny gen keyword in edition_2024_compat lintsMichael Goulet-0/+5
2024-04-20Rollup merge of #123986 - ehuss:lint-renamed, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-0/+89
lint-docs: Add redirects for renamed lints. This updates the lint docs to include a redirect for renamed lints to the new name. This helps ensure that links to the old name will still be valid. Note that this currently uses a hard-coded list. As mentioned in the comment, a future enhancement may gather this information in a better way. Unblocks #123680
2024-04-15Fix docs for unstable_features lint.Eric Huss-1/+0
2024-04-15lint-docs: Add redirects for renamed lints.Eric Huss-0/+89
2024-03-05Split refining_impl_trait lint into _reachable, _internal variantsTyler Mandry-0/+4
2024-01-07Update test for `E0796` and `static_mut_ref` lintObei Sideg-0/+1
2023-07-11Revert "Fix `x test lint-docs` when download-rustc is enabled"jyn-7/+0
This was not the correct fix. The problem was two-fold: - `download-rustc` didn't respect `llvm.assertions` - `rust-dev` was missing a bump to `download-ci-llvm-stamp` The first is fixed in this PR and the latter was fixed a while ago. Revert this change to avoid breaking `rpath = false`.
2023-04-18Fix `x test lint-docs` when download-rustc is enabledjyn-1/+11
Bootstrap was setting LD_LIBRARY_PATH for bootstrap tools in `tool_cmd`, and rustc inherited that environment. That broke when download-rustc was enabled; see the new comment for details.
2023-02-28Collect all matching messages for a lint.Eric Huss-29/+28
Some examples may contain multiple lines which trigger the lint. Previously it would only display the first message. This updates it so that all matching instances of the lint are displayed.
2023-02-28Add check for errant {{produces}} marker.Eric Huss-4/+34
If a lint example has an `ignore` tag, but the lint author also includes the {{produces}} marker, then the output will just contain the text `{{produces}}`. This adds a check for this mistake and provides help on how the lint docs should be written.
2022-10-24fix the lint as requestedKagami Sascha Rosylight-4/+2
2022-06-04Add `let_underscore` lint group to `GROUP_DESCRIPTIONS`.Aaron Kofsky-0/+1
2022-05-19Minor tweaks to rustc book summary formatting.Eric Huss-3/+3
2021-09-20Adjust documentation for compatibility with 2021Mark Rousskov-0/+4
This also adjusts the lint docs generation to accept (and ignore) an allow attribute, rather than expecting the documentation to be immediately followed by the lint name.
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-06Allow lint names to have ascii numbersRyan Levick-1/+3
2021-04-26Add 2021 compatibility lint descriptionRyan Levick-0/+1
2020-12-26lint-docs: Warn on missing lint when documenting.Eric Huss-6/+16
2020-12-06Fix trimming of lint docsCamelid-2/+2
It was removing all the indentation before. Co-authored-by: Eric Huss <eric@huss.org>
2020-11-29lint-docs: Use strip-prefix to simplify.Eric Huss-4/+3
2020-11-29lint-docs: Add some extra detail to the error message.Eric Huss-0/+13
This will hopefully help users figure out what was wrong and how to fix it.
2020-11-28lint-docs: Add --validate flag to validate lint docs separately.Eric Huss-18/+57
2020-11-28lint-docs: Move free functions into methods of LintExtractor.Eric Huss-469/+470
This helps avoid needing to pass so many parameters around.
2020-09-16Pass --target to lint docsMark Rousskov-14/+34
Otherwise, we may not have a standard library built for the native "host" target of the rustc being run.
2020-09-14Include non-JSON output in error display for lint-doc failure.Eric Huss-1/+4
Some errors, like if rustc is broken, or dylib search path is wrong, will only display non-JSON errors. Show those, too, to make it easier to debug a problem.