@@ -97,7 +97,7 @@ impl fmt::Default for clean::Path {
9797 }
9898}
9999
100- fn resolved_path ( w : & mut io:: Writer , id : ast:: NodeId ,
100+ fn resolved_path ( w : & mut io:: Writer , did : ast:: DefId ,
101101 path : & clean:: Path , print_all : bool ) {
102102 // The generics will get written to both the title and link
103103 let mut generics = ~"";
@@ -144,9 +144,10 @@ fn resolved_path(w: &mut io::Writer, id: ast::NodeId,
144144
145145 do local_data:: get ( cache_key) |cache| {
146146 do cache. unwrap ( ) . read |cache| {
147- match cache. paths . find ( & id ) {
147+ match cache. paths . find ( & did . node ) {
148148 // 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) => {
150151 let fqn = fqp. connect ( "::" ) ;
151152 let same = loc. iter ( ) . zip ( fqp. iter ( ) )
152153 . take_while ( |& ( a, b) | * a == * b) . len ( ) ;
@@ -180,7 +181,7 @@ fn resolved_path(w: &mut io::Writer, id: ast::NodeId,
180181 write ! ( w, "<a class='{}' href='{}' title='{}'>{}</a>{}" ,
181182 shortty, url, fqn, last. name, generics) ;
182183 }
183- None => {
184+ _ => {
184185 if print_all {
185186 let amt = path. segments . len ( ) - 1 ;
186187 for seg in path. segments . iter ( ) . take ( amt) {
@@ -205,8 +206,8 @@ impl fmt::Default for clean::Type {
205206 }
206207 }
207208 }
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 ) ;
210211 match * typarams {
211212 Some ( ref params) => {
212213 f. buf . write ( "<" . as_bytes ( ) ) ;
@@ -219,10 +220,6 @@ impl fmt::Default for clean::Type {
219220 None => { }
220221 }
221222 }
222- // XXX: this should be a link
223- clean:: External ( ref a, _) => {
224- write ! ( f. buf, "{}" , * a) ;
225- }
226223 clean:: Self ( * ) => f. buf . write ( "Self" . as_bytes ( ) ) ,
227224 clean:: Primitive ( prim) => {
228225 let s = match prim {
@@ -421,8 +418,8 @@ impl fmt::Default for clean::ViewPath {
421418impl fmt:: Default for clean:: ImportSource {
422419 fn fmt ( v : & clean:: ImportSource , f : & mut fmt:: Formatter ) {
423420 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 ) ;
426423 }
427424 _ => {
428425 for ( i, seg) in v. path . segments . iter ( ) . enumerate ( ) {
@@ -437,7 +434,7 @@ impl fmt::Default for clean::ImportSource {
437434impl fmt:: Default for clean:: ViewListIdent {
438435 fn fmt ( v : & clean:: ViewListIdent , f : & mut fmt:: Formatter ) {
439436 match v. source {
440- Some ( did) if ast_util :: is_local ( did ) => {
437+ Some ( did) => {
441438 let path = clean:: Path {
442439 global : false ,
443440 segments : ~[ clean:: PathSegment {
@@ -446,7 +443,7 @@ impl fmt::Default for clean::ViewListIdent {
446443 types : ~[ ] ,
447444 } ]
448445 } ;
449- resolved_path ( f. buf , did. node , & path, false ) ;
446+ resolved_path ( f. buf , did, & path, false ) ;
450447 }
451448 _ => write ! ( f. buf, "{}" , v. name) ,
452449 }
0 commit comments