Commit Graph

34 Commits

Author SHA1 Message Date
Michael Goulet
7f565ed282 Don't pass lint back out of lint decorator 2023-12-15 16:05:36 +00:00
zetanumbers
24f009c5e5 Move some methods from tcx.hir() to tcx
Renamings:
- find -> opt_hir_node
- get -> hir_node
- find_by_def_id -> opt_hir_node_by_def_id
- get_by_def_id -> hir_node_by_def_id

Fix rebase changes using removed methods

Use `tcx.hir_node_by_def_id()` whenever possible in compiler

Fix clippy errors

Fix compiler

Apply suggestions from code review

Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>

Add FIXME for `tcx.hir()` returned type about its removal

Simplify with with `tcx.hir_node_by_def_id`
2023-12-12 06:40:29 -08:00
Vadim Petrochenkov
c697927f44 rustc: hir().local_def_id_to_hir_id() -> tcx.local_def_id_to_hir_id() cleanup 2023-11-26 12:41:21 +03:00
Mark Rousskov
917f6540ed Re-format code with new rustfmt 2023-11-15 21:45:48 -05:00
Guillaume Gomez
e1294b26af Don't emit an error if the custom_code_classes_in_docs feature is disabled when its syntax is used. 2023-09-17 15:11:44 +02:00
Noah Lev
062d247cd7 rustdoc: Rename clean items from typedef to type alias 2023-08-21 13:56:22 -07:00
Guillaume Gomez
a1a94b1c0f Improve code readability by moving fmt args directly into the string 2023-08-16 16:35:23 +02:00
Guillaume Gomez
82bf232245 Move inherits_doc_hidden and should_ignore_res into clean/utils.rs 2023-07-29 14:39:10 +02:00
Guillaume Gomez
ab80b36452 Correctly handle --document-hidden-items 2023-07-14 17:25:09 +02:00
Mark Rousskov
cc907f80b9 Re-format let-else per rustfmt update 2023-07-12 21:49:27 -04:00
Vadim Petrochenkov
4082053b00 rustdoc: Cleanup doc string collapsing 2023-05-22 19:35:35 +03:00
Guillaume Gomez
fb160d5d3b Modules can be reexported and it should be handled by rustdoc 2023-05-05 21:33:44 +02:00
Vadim Petrochenkov
c83553da31 rustc_middle: Remove trait DefIdTree
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-03-02 23:46:44 +04:00
Guillaume Gomez
86fd5a1b44 Use more let chain 2023-02-15 12:00:03 +01:00
Vadim Petrochenkov
347fa7a26f rustdoc: Stop using HirIds
Use `LocalDefId`s instead
2023-01-26 16:45:49 +04:00
Michael Goulet
6af339dbfa rename find_parent_node to opt_parent_id 2023-01-04 00:43:13 +00:00
Vadim Petrochenkov
90f27f93bd rustdoc: Split effective visibilities from rustc from similar data built by rustdoc for external def-ids 2022-10-29 23:36:52 +04:00
Vadim Petrochenkov
34eb73c72d privacy: Rename "accessibility levels" to "effective visibilities"
And a couple of other naming tweaks

Related to https://github.com/rust-lang/rust/issues/48054
2022-10-26 16:34:53 +04:00
Maybe Waffle
6ecacf76bc rustdoc: adopt to the new lint API 2022-10-01 10:03:06 +00:00
Wim Looman
72cf46aa72 Feature gate the rustdoc::missing_doc_code_examples lint 2022-09-12 21:20:24 +02:00
est31
96c051fd07 Box TypedefItem, ImplItem, AssocTypeItem variants of ItemKind
This reduces ItemKind size from 224 bytes to 160 bytes.
2022-07-29 19:30:25 +02:00
Guillaume Gomez
8e150816c2 Remove unused field in ItemKind::KeywordItem 2022-07-21 16:05:17 +02:00
klensy
678059f7d0 fix simple clippy lints 2022-05-24 12:24:41 -04:00
Jacob Pratt
6970246886 Remove crate visibility modifier in libs, tests 2022-05-21 00:32:47 -04:00
Guillaume Gomez
b1e6211c5c Rename def_id into item_id when the type is ItemId for readability 2022-04-16 14:28:09 +02:00
León Orell Valerian Liehr
8de453a8c6 rustdoc: discr. required+provided assoc consts+tys 2022-04-12 15:38:39 +02:00
mark
bb8d4307eb rustc_error: make ErrorReported impossible to construct
There are a few places were we have to construct it, though, and a few
places that are more invasive to change. To do this, we create a
constructor with a long obvious name.
2022-03-16 10:35:24 -05:00
est31
565f644edf librustdoc: adopt let else in more places 2022-03-04 10:33:29 +01:00
Michael Goulet
ca6e06efba make GATs print properly in traits 2022-02-27 21:36:29 -08:00
avitex
b0a1a4469a Fix rustdoc::private_doc_tests lint for public re-exported items
This involves changing the lint to check the access level is exported,
rather than public. The exported access level accounts for public items
and items accessible to other crates with the help of `pub use`
re-exports. The pattern of re-exporting public items from a private
module is usage seen in a number of popular crates.
2021-12-28 21:37:08 +11:00
Jacob Hoffman-Andrews
1d10e1acf6 Add module documentation for rustdoc passes
These are currently documented at
https://rustc-dev-guide.rust-lang.org/rustdoc-internals.html#hot-potato
but can easily go out of date. We'd like to document them in place and
link to
https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/passes/index.html
2021-12-15 21:45:31 -08:00
Noah Lev
b74287076c Convert many impls of DocFolder to DocVisitor
Many of `DocFolder`'s impls didn't actually transform the syntax tree,
so they can be visitors instead.
2021-10-31 21:24:11 -07:00
Guillaume Gomez
4614ca4541 Fix clippy lints in librustdoc 2021-10-25 11:30:09 +02:00
Noah Lev
abbead78f7 rustdoc: Improve doctest pass's name and module's name
As the docs at the top of the file say, it is an overloaded pass and
actually runs two lints.
2021-10-02 14:15:34 -07:00