File tree 3 files changed +22
-6
lines changed
3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,10 @@ impl Res {
80
80
}
81
81
}
82
82
83
- fn def_id ( self , tcx : TyCtxt < ' _ > ) -> DefId {
83
+ fn def_id ( self , tcx : TyCtxt < ' _ > ) -> Option < DefId > {
84
84
match self {
85
- Res :: Def ( _, id) => id ,
86
- Res :: Primitive ( prim) => * PrimitiveType :: primitive_locations ( tcx) . get ( & prim) . unwrap ( ) ,
85
+ Res :: Def ( _, id) => Some ( id ) ,
86
+ Res :: Primitive ( prim) => PrimitiveType :: primitive_locations ( tcx) . get ( & prim) . copied ( ) ,
87
87
}
88
88
}
89
89
@@ -1127,10 +1127,10 @@ impl LinkCollector<'_, '_> {
1127
1127
}
1128
1128
}
1129
1129
1130
- Some ( ItemLink {
1130
+ res . def_id ( self . cx . tcx ) . map ( |page_id| ItemLink {
1131
1131
link : ori_link. link . clone ( ) ,
1132
1132
link_text : link_text. clone ( ) ,
1133
- page_id : res . def_id ( self . cx . tcx ) ,
1133
+ page_id,
1134
1134
fragment,
1135
1135
} )
1136
1136
}
Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ pub(crate) fn early_resolve_intra_doc_links(
48
48
link_resolver. resolve_doc_links_local ( & krate. attrs ) ;
49
49
link_resolver. process_module_children_or_reexports ( CRATE_DEF_ID . to_def_id ( ) ) ;
50
50
visit:: walk_crate ( & mut link_resolver, krate) ;
51
- link_resolver. process_extern_impls ( ) ;
52
51
53
52
// FIXME: somehow rustdoc is still missing crates even though we loaded all
54
53
// the known necessary crates. Load them all unconditionally until we find a way to fix this.
@@ -58,6 +57,8 @@ pub(crate) fn early_resolve_intra_doc_links(
58
57
link_resolver. resolver . resolve_rustdoc_path ( extern_name, TypeNS , parent_scope) ;
59
58
}
60
59
60
+ link_resolver. process_extern_impls ( ) ;
61
+
61
62
ResolverCaches {
62
63
markdown_links : Some ( link_resolver. markdown_links ) ,
63
64
doc_link_resolutions : link_resolver. doc_link_resolutions ,
Original file line number Diff line number Diff line change
1
+ // Crate tree without a `doc(primitive)` module for primitive type linked to by a doc link.
2
+
3
+ #![ deny( rustdoc:: broken_intra_doc_links) ]
4
+ #![ feature( no_core, lang_items, rustc_attrs) ]
5
+ #![ no_core]
6
+ #![ rustc_coherence_is_core]
7
+ #![ crate_type = "rlib" ]
8
+
9
+ // @has no_doc_primitive/index.html
10
+ //! A [`char`] and its [`char::len_utf8`].
11
+ impl char {
12
+ pub fn len_utf8 ( self ) -> usize {
13
+ 42
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments