Eagerly fetch typeck results when linting - #157928
Conversation
|
cc @rust-lang/clippy |
|
r? @Kivooeo rustbot has assigned @Kivooeo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Turns out that was load bearing for rustdoc. That's now been worked around and documented properly. |
This comment has been minimized.
This comment has been minimized.
|
@bors try parent=4fc35880d9636c5a2679d18b034038123b09b294 @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Eagerly fetch typeck results when linting
This comment has been minimized.
This comment has been minimized.
|
Error occured while categorizing benchmark run:
|
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Eagerly fetch typeck results when linting
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot reroll |
80ae54c to
6883244
Compare
This comment has been minimized.
This comment has been minimized.
| /// Runs only the `MissingDoc` lint pass without type checking bodies. | ||
| /// | ||
| /// **DO NOT** use this for anything other than rustdoc. This exists solely to workaround | ||
| /// the fact that rustdoc parses functions which would not pass type checking. See: |
There was a problem hiding this comment.
We can just check sess.opts.actually_rustdoc instead? If it's rustdoc then we don't typeck.
Seems a much smaller code change.
There was a problem hiding this comment.
Did it that way so you can see it. It's smaller, but it was already small to start with.
This has the (very small) cost of actually checking if it's rustdoc. PGO will make it so the default branch prediction is correct so it's only a couple of extra instructions per body. MissingDocs is given it's own dedicated monomorphization of the visitor in both cases so there's no code size savings with the dynamic approach. Again, these are minor code size and instruction count costs, but they are there.
This comment has been minimized.
This comment has been minimized.
|
@bors r+ rollup |
Eagerly fetch typeck results when linting The first commit avoids running the lint visitor if all lints were filtered out. In every other case the typeck results are accessed on every body making the delayed load pointless overhead.
Eagerly fetch typeck results when linting The first commit avoids running the lint visitor if all lints were filtered out. In every other case the typeck results are accessed on every body making the delayed load pointless overhead.
Rollup of 14 pull requests Successful merges: - #159245 (Emit retags in codegen to support BorrowSanitizer (part 5)) - #159864 (Report "capacity overflow" for oversized Rc<[T]>/Arc<[T]>) - #160079 (make atomic operations const) - #160124 (Structurally prevent zero-count `BackendRepr::SimdVector`s) - #160162 (Make `#[fundamental]` only apply to the first argument of `Box`) - #160210 (Remove an outdated FIXME) - #160282 (Improve diagnostic for patterns in function pointer types) - #157928 (Eagerly fetch typeck results when linting) - #159672 (Improve suggestions when multiples tuples implement the same trait) - #159861 (Add documentation for the `non_exhaustive` attribute) - #159907 (Fix `hidden_glob_reexports` in `rustc_ast`) - #159998 (Align expect messages with guidance) - #160145 (Expand checks for register_tool) - #160307 (Update `minifier` version to `0.4.0`)
Rollup merge of #157928 - Jarcho:eager_typeck, r=adwinwhite Eagerly fetch typeck results when linting The first commit avoids running the lint visitor if all lints were filtered out. In every other case the typeck results are accessed on every body making the delayed load pointless overhead.
View all comments
The first commit avoids running the lint visitor if all lints were filtered out. In every other case the typeck results are accessed on every body making the delayed load pointless overhead.