@@ -14,7 +14,7 @@ use rustc_hir::def::{DefKind, Namespace, PerNS};
14
14
use rustc_hir:: def_id:: { DefId , CRATE_DEF_ID } ;
15
15
use rustc_hir:: Mutability ;
16
16
use rustc_middle:: ty:: { Ty , TyCtxt } ;
17
- use rustc_middle:: { bug, ty} ;
17
+ use rustc_middle:: { bug, span_bug , ty} ;
18
18
use rustc_resolve:: rustdoc:: { has_primitive_or_keyword_docs, prepare_to_doc_link_resolution} ;
19
19
use rustc_resolve:: rustdoc:: { strip_generics_from_path, MalformedGenerics } ;
20
20
use rustc_session:: lint:: Lint ;
@@ -402,7 +402,12 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
402
402
// `doc_link_resolutions` is missing a `path_str`, that means that there are valid links
403
403
// that are being missed. To fix the ICE, change
404
404
// `rustc_resolve::rustdoc::attrs_to_preprocessed_links` to cache the link.
405
- . unwrap_or_else ( || panic ! ( "no resolution for {:?} {:?} {:?}" , path_str, ns, module_id) )
405
+ . unwrap_or_else ( || {
406
+ span_bug ! (
407
+ self . cx. tcx. def_span( item_id) ,
408
+ "no resolution for {path_str:?} {ns:?} {module_id:?}" ,
409
+ )
410
+ } )
406
411
. and_then ( |res| res. try_into ( ) . ok ( ) )
407
412
. or_else ( || resolve_primitive ( path_str, ns) ) ;
408
413
debug ! ( "{} resolved to {:?} in namespace {:?}" , path_str, result, ns) ;
@@ -963,6 +968,7 @@ fn preprocessed_markdown_links(s: &str) -> Vec<PreprocessedMarkdownLink> {
963
968
}
964
969
965
970
impl LinkCollector < ' _ , ' _ > {
971
+ #[ instrument( level = "debug" , skip_all) ]
966
972
fn resolve_links ( & mut self , item : & Item ) {
967
973
if !self . cx . render_options . document_private
968
974
&& let Some ( def_id) = item. item_id . as_def_id ( )
0 commit comments