about summary refs log tree commit diff
path: root/src/librustdoc/passes/lint
AgeCommit message (Collapse)AuthorLines
2023-12-18Rename many `DiagCtxt` and `EarlyDiagCtxt` locals.Nicholas Nethercote-2/+2
2023-12-18Rename `ParseSess::with_span_handler` as `ParseSess::with_dcx`.Nicholas Nethercote-1/+1
2023-12-18Rename `Handler` as `DiagCtxt`.Nicholas Nethercote-2/+2
2023-12-15Don't pass lint back out of lint decoratorMichael Goulet-12/+2
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-1/+1
cleanup
2023-11-15Re-format code with new rustfmtMark Rousskov-1/+3
2023-11-08rustdoc: minor changes suggested by clippy perf lints.Nicholas Nethercote-1/+1
2023-11-03clone lessMatthias Krüger-78/+72
2023-09-17Don't emit an error if the `custom_code_classes_in_docs` feature is disabled ↵Guillaume Gomez-1/+3
when its syntax is used.
2023-09-08Reuse rustdoc's doc comment handling in ClippyAlex Macleod-29/+48
2023-08-21rustdoc: use unicode-aware checks for redundant explicit link fastpathMichael Howell-6/+1
Fixes #115064
2023-08-18Fix formatKyle Lin-1/+1
2023-08-18Fix private function importingKyle Lin-1/+1
2023-08-18Skip lint check when item is not fully publicKyle Lin-0/+19
2023-08-18relax redundancy constraintKyle Lin-6/+1
2023-08-18narrow down the lint trigger constraintKyle Lin-0/+10
2023-08-18fomar filesKyle Lin-4/+9
2023-08-18Still resolving rustdoc resolution panickingKyle Lin-25/+51
2023-08-18Support Reference & ReferenceUnknown link lintKyle Lin-51/+160
2023-08-18Refactor lint from rustc to rustdocKyle Lin-0/+188
2023-08-16Improve code readability by moving fmt args directly into the stringGuillaume Gomez-10/+10
2023-07-25Use a builder instead of boolean/option argumentsOli Scherer-1/+1
2023-07-19On nightly, dump ICE backtraces to diskEsteban Küber-1/+1
Implement rust-lang/compiler-team#578. When an ICE is encountered on nightly releases, the new rustc panic handler will also write the contents of the backtrace to disk. If any `delay_span_bug`s are encountered, their backtrace is also added to the file. The platform and rustc version will also be collected.
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-12/+12
2023-05-29Use `Cow` in `{D,Subd}iagnosticMessage`.Nicholas Nethercote-97/+104
Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment: ``` // FIXME(davidtwco): can a `Cow<'static, str>` be used here? ``` This commit answers that question in the affirmative. It's not the most compelling change ever, but it might be worth merging. This requires changing the `impl<'a> From<&'a str>` impls to `impl From<&'static str>`, which involves a bunch of knock-on changes that require/result in call sites being a little more precise about exactly what kind of string they use to create errors, and not just `&str`. This will result in fewer unnecessary allocations, though this will not have any notable perf effects given that these are error paths. Note that I was lazy within Clippy, using `to_string` in a few places to preserve the existing string imprecision. I could have used `impl Into<{D,Subd}iagnosticMessage>` in various places as is done in the compiler, but that would have required changes to *many* call sites (mostly changing `&format("...")` to `format!("...")`) which didn't seem worthwhile.
2023-05-27Rollup merge of #112018 - GuillaumeGomez:cleanup-tcx, r=notriddleMatthias Krüger-1/+1
Clean up usage of `cx.tcx` when `tcx` is already set into a variable I discovered a few cases where `cx.tcx` (and equivalents) was used whereas `tcx` was already stored into a variable. In those cases, better to just use `tcx` directly. r? `@notriddle`
2023-05-27Clean up usage of `cx.tcx` when `tcx` is already set into a variableGuillaume Gomez-1/+1
2023-05-22rustdoc: Cleanup doc string collapsingVadim Petrochenkov-4/+4
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-3/+3
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-04-29Add `rustdoc::unescaped_backtick` lintLukas Markeffsky-0/+416
2023-02-22rustdoc: reduce allocations when generating tooltipsMichael Howell-1/+1
An attempt to reduce the perf regression in https://github.com/rust-lang/rust/pull/108052#issuecomment-1430631861
2023-02-22various: translation resources from cg backendDavid Wood-2/+4
Extend `CodegenBackend` trait with a function returning the translation resources from the codegen backend, which can be added to the complete list of resources provided to the emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22errors: generate typed identifiers in each crateDavid Wood-1/+1
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-15Use more let chainGuillaume Gomez-5/+3
2023-01-26rustdoc: Stop using `HirId`sVadim Petrochenkov-3/+2
Use `LocalDefId`s instead
2023-01-08Make translate_message return result and add testsmejrs-1/+3
2022-11-22Consolidate rustdoc's lint passes into a single passNoah Lev-0/+666
This should improve performance and simplify the code.