]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #96118 - GuillaumeGomez:cleanup-def-id-item-id, r=notriddle
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Sat, 16 Apr 2022 17:42:07 +0000 (19:42 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Apr 2022 17:42:07 +0000 (19:42 +0200)
rustdoc: Rename `def_id` into `item_id` when the type is `ItemId` for readability

As `@notriddle` mentioned in https://github.com/rust-lang/rust/pull/96091, the field name is inaccurate. This PR fixes it by renaming it accordingly to its real type.

r? `@notriddle`

1  2 
src/librustdoc/passes/html_tags.rs

index a620ffa98786021454abebda501b0509d7ce2845,4bd8a691a88a56c65792c8afe6005a80f820dac9..044f224e7885c24727e4907977331b2faef474df
@@@ -197,7 -197,7 +197,7 @@@ fn extract_tags
  impl<'a, 'tcx> DocVisitor for InvalidHtmlTagsLinter<'a, 'tcx> {
      fn visit_item(&mut self, item: &Item) {
          let tcx = self.cx.tcx;
-         let Some(hir_id) = DocContext::as_local_hir_id(tcx, item.def_id)
+         let Some(hir_id) = DocContext::as_local_hir_id(tcx, item.item_id)
          // If non-local, no need to check anything.
          else { return };
          let dox = item.attrs.collapsed_doc_value().unwrap_or_default();
                      // We don't try to detect stuff `<like, this>` because that's not valid HTML,
                      // and we don't try to detect stuff `<like this>` because that's not valid Rust.
                      if let Some(Some(generics_start)) = (is_open_tag
 -                        && dox[..range.end].ends_with(">"))
 +                        && dox[..range.end].ends_with('>'))
                      .then(|| extract_path_backwards(&dox, range.start))
                      {
                          let generics_sp = match super::source_span_for_markdown_range(