@@ -97,7 +97,7 @@ impl fmt::Default for clean::Path {
97
97
}
98
98
}
99
99
100
- fn resolved_path ( w : & mut io:: Writer , id : ast:: NodeId ,
100
+ fn resolved_path ( w : & mut io:: Writer , did : ast:: DefId ,
101
101
path : & clean:: Path , print_all : bool ) {
102
102
// The generics will get written to both the title and link
103
103
let mut generics = ~"";
@@ -144,9 +144,10 @@ fn resolved_path(w: &mut io::Writer, id: ast::NodeId,
144
144
145
145
do local_data:: get ( cache_key) |cache| {
146
146
do cache. unwrap ( ) . read |cache| {
147
- match cache. paths . find ( & id ) {
147
+ match cache. paths . find ( & did . node ) {
148
148
// This is a documented path, link to it!
149
- Some ( & ( ref fqp, shortty) ) => {
149
+ // FIXME(#9539): this is_local check should not exist
150
+ Some ( & ( ref fqp, shortty) ) if ast_util:: is_local ( did) => {
150
151
let fqn = fqp. connect ( "::" ) ;
151
152
let same = loc. iter ( ) . zip ( fqp. iter ( ) )
152
153
. take_while ( |& ( a, b) | * a == * b) . len ( ) ;
@@ -180,7 +181,7 @@ fn resolved_path(w: &mut io::Writer, id: ast::NodeId,
180
181
write ! ( w, "<a class='{}' href='{}' title='{}'>{}</a>{}" ,
181
182
shortty, url, fqn, last. name, generics) ;
182
183
}
183
- None => {
184
+ _ => {
184
185
if print_all {
185
186
let amt = path. segments . len ( ) - 1 ;
186
187
for seg in path. segments . iter ( ) . take ( amt) {
@@ -205,8 +206,8 @@ impl fmt::Default for clean::Type {
205
206
}
206
207
}
207
208
}
208
- clean:: ResolvedPath { id , typarams : ref typarams, path : ref path} => {
209
- resolved_path ( f. buf , id , path, false ) ;
209
+ clean:: ResolvedPath { did , typarams : ref typarams, path : ref path} => {
210
+ resolved_path ( f. buf , did , path, false ) ;
210
211
match * typarams {
211
212
Some ( ref params) => {
212
213
f. buf . write ( "<" . as_bytes ( ) ) ;
@@ -219,10 +220,6 @@ impl fmt::Default for clean::Type {
219
220
None => { }
220
221
}
221
222
}
222
- // XXX: this should be a link
223
- clean:: External ( ref a, _) => {
224
- write ! ( f. buf, "{}" , * a) ;
225
- }
226
223
clean:: Self ( * ) => f. buf . write ( "Self" . as_bytes ( ) ) ,
227
224
clean:: Primitive ( prim) => {
228
225
let s = match prim {
@@ -421,8 +418,8 @@ impl fmt::Default for clean::ViewPath {
421
418
impl fmt:: Default for clean:: ImportSource {
422
419
fn fmt ( v : & clean:: ImportSource , f : & mut fmt:: Formatter ) {
423
420
match v. did {
424
- Some ( did) if ast_util :: is_local ( did ) => {
425
- resolved_path ( f. buf , did. node , & v. path , true ) ;
421
+ Some ( did) => {
422
+ resolved_path ( f. buf , did, & v. path , true ) ;
426
423
}
427
424
_ => {
428
425
for ( i, seg) in v. path . segments . iter ( ) . enumerate ( ) {
@@ -437,7 +434,7 @@ impl fmt::Default for clean::ImportSource {
437
434
impl fmt:: Default for clean:: ViewListIdent {
438
435
fn fmt ( v : & clean:: ViewListIdent , f : & mut fmt:: Formatter ) {
439
436
match v. source {
440
- Some ( did) if ast_util :: is_local ( did ) => {
437
+ Some ( did) => {
441
438
let path = clean:: Path {
442
439
global : false ,
443
440
segments : ~[ clean:: PathSegment {
@@ -446,7 +443,7 @@ impl fmt::Default for clean::ViewListIdent {
446
443
types : ~[ ] ,
447
444
} ]
448
445
} ;
449
- resolved_path ( f. buf , did. node , & path, false ) ;
446
+ resolved_path ( f. buf , did, & path, false ) ;
450
447
}
451
448
_ => write ! ( f. buf, "{}" , v. name) ,
452
449
}
0 commit comments