Change:
This looks similar to , but this wasn't fixed by <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: : <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details modify labels +A-resolve
This ICE seems to be related to intra-doc link resolution, not standard name resolution. My bad :sweat_smile: modify labels +A-intra-doc-links -A-resolve
Minimum reproduction code:
The issue is in rustdoc, it passes a wrong parent module ( instead of the root ) when requesting resolutions for .
The resolution exists in rustc tables, it's just attached to , not .
The issue is in rustdoc, it passes a wrong parent module is currently used for determining the parent module, but it's wrong for inlined items because for them represents the target item, not the item itself. It looks like can be used instead, I'm just not sure how consistently it's set.
Thanks for the information! Wanna send the fix? Otherwise I plan to do it in the next days.
Fixed in The issue turned out a bit deeper than described in

Discussion:
use std::mem; use thin_vec::ThinVec; <ins> use crate::clean::inline::merge_attrs; </ins> use crate::core::{self, DocContext, ImplTraitParam}; use crate::formats::item_type::ItemType; use crate::visit_ast::Module as DocModule;

_ => unreachable!("not yet converted"), }; <del> let mut extra_attrs = Vec::new(); </del> <ins> let mut import_attrs = Vec::new(); let mut target_attrs = Vec::new(); </ins> if let Some(import_id) = import_id && let Some(hir::Node::Item(use_node)) = cx.tcx.hir().find_by_def_id(import_id) { let is_inline = inline::load_attrs(cx, import_id.to_def_id()).lists(sym::doc).get_word_attr(sym::inline).is_some(); // Then we get all the various imports' attributes. <del> get_all_import_attributes(use_node, cx.tcx, item.owner_id.def_id, &mut extra_attrs, is_inline); add_without_unwanted_attributes(&mut extra_attrs, inline::load_attrs(cx, def_id), is_inline); </del> <ins> get_all_import_attributes(use_node, cx.tcx, item.owner_id.def_id, &mut import_attrs, is_inline); add_without_unwanted_attributes(&mut target_attrs, inline::load_attrs(cx, def_id), is_inline); </ins> } else { // We only keep the item's attributes. <del> extra_attrs.extend_from_slice(inline::load_attrs(cx, def_id)); </del> <ins> target_attrs.extend_from_slice(inline::load_attrs(cx, def_id)); </ins> } <del> let attrs = Attributes::from_ast(&extra_attrs); let cfg = extra_attrs.cfg(cx.tcx, &cx.cache.hidden_cfg); </del> <ins> let import_parent = import_id.map(|import_id| cx.tcx.local_parent(import_id).to_def_id()); let (attrs, cfg) =  merge_attrs(cx, import_parent, &target_attrs, Some(&import_attrs)); </ins> let mut item = Item::from_def_id_and_attrs_and_parts(def_id, Some(name), kind, Box::new(attrs), cfg);

<ins> // Import for `A` is inlined and doc comments on the import and `A` itself are merged. // After the merge they still have correct parent scopes to resolve both `[A]` and `[B]`. // check-pass #![allow(rustdoc::private_intra_doc_links)] mod m { /// [B] pub struct A {} pub struct B {} } /// [A] pub use m::A; </ins>