File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -61,12 +61,16 @@ impl fmt::Debug for DefId {
6161 // Unfortunately, there seems to be no way to attempt to print
6262 // a path for a def-id, so I'll just make a best effort for now
6363 // and otherwise fallback to just printing the crate/node pair
64- try!( ty:: tls:: with_opt ( |opt_tcx| {
65- if let Some ( tcx) = opt_tcx {
66- try!( write ! ( f, " => {}" , tcx. item_path_str( * self ) ) ) ;
67- }
68- Ok ( ( ) )
69- } ) ) ;
64+ if self . is_local ( ) { // (1)
65+ // (1) side-step fact that not all external things have paths at
66+ // the moment, such as type parameters
67+ try!( ty:: tls:: with_opt ( |opt_tcx| {
68+ if let Some ( tcx) = opt_tcx {
69+ try!( write ! ( f, " => {}" , tcx. item_path_str( * self ) ) ) ;
70+ }
71+ Ok ( ( ) )
72+ } ) ) ;
73+ }
7074
7175 write ! ( f, " }}" )
7276 }
You can’t perform that action at this time.
0 commit comments