]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/passes/collect_intra_doc_links.rs
Rollup merge of #69405 - NieDzejkob:docs-readline-appends, r=joshtriplett
[rust.git] / src / librustdoc / passes / collect_intra_doc_links.rs
index 79bcfe7aee7447ee9caffd0eb364b0a1e13e89be..0b27e5cf8060fc29b5afa8de440030711825868b 100644 (file)
@@ -95,7 +95,7 @@ fn variant_field(
                     .tcx
                     .inherent_impls(did)
                     .iter()
-                    .flat_map(|imp| cx.tcx.associated_items(*imp))
+                    .flat_map(|imp| cx.tcx.associated_items(*imp).in_definition_order())
                     .any(|item| item.ident.name == variant_name)
                 {
                     return Err(ErrorKind::ResolutionFailure);
@@ -206,8 +206,8 @@ fn resolve(
                 return cx
                     .tcx
                     .associated_items(did)
-                    .iter()
-                    .find(|item| item.ident.name == item_name)
+                    .filter_by_name_unhygienic(item_name)
+                    .next()
                     .and_then(|item| match item.kind {
                         ty::AssocKind::Method => Some("method"),
                         _ => None,
@@ -234,7 +234,7 @@ fn resolve(
                         .tcx
                         .inherent_impls(did)
                         .iter()
-                        .flat_map(|imp| cx.tcx.associated_items(*imp))
+                        .flat_map(|imp| cx.tcx.associated_items(*imp).in_definition_order())
                         .find(|item| item.ident.name == item_name);
                     if let Some(item) = item {
                         let out = match item.kind {