@@ -942,7 +942,7 @@ fn ambiguity_error(cx: &DocContext, attrs: &Attributes,
942
942
select the {}",
943
943
disambig1, kind1, disambig2,
944
944
kind2) )
945
- . emit ( ) ;
945
+ . emit ( ) ;
946
946
}
947
947
948
948
/// Given an enum variant's def, return the def of its enum and the associated fragment
@@ -1087,6 +1087,7 @@ fn macro_resolve(cx: &DocContext, path_str: &str) -> Option<Def> {
1087
1087
}
1088
1088
}
1089
1089
1090
+ #[ derive( Debug ) ]
1090
1091
enum PathKind {
1091
1092
/// can be either value or type, not a macro
1092
1093
Unknown ,
@@ -1095,7 +1096,7 @@ enum PathKind {
1095
1096
/// values, functions, consts, statics, everything in the value namespace
1096
1097
Value ,
1097
1098
/// types, traits, everything in the type namespace
1098
- Type
1099
+ Type ,
1099
1100
}
1100
1101
1101
1102
impl Clean < Attributes > for [ ast:: Attribute ] {
@@ -1104,12 +1105,13 @@ impl Clean<Attributes> for [ast::Attribute] {
1104
1105
1105
1106
if UnstableFeatures :: from_environment ( ) . is_nightly_build ( ) {
1106
1107
let dox = attrs. collapsed_doc_value ( ) . unwrap_or_else ( String :: new) ;
1107
- for link in markdown_links ( & dox) {
1108
+ for ori_link in markdown_links ( & dox) {
1108
1109
// bail early for real links
1109
- if link . contains ( '/' ) {
1110
+ if ori_link . contains ( '/' ) {
1110
1111
continue ;
1111
1112
}
1112
- let ( def, fragment) = {
1113
+ let link = ori_link. replace ( "`" , "" ) ;
1114
+ let ( def, fragment) = {
1113
1115
let mut kind = PathKind :: Unknown ;
1114
1116
let path_str = if let Some ( prefix) =
1115
1117
[ "struct@" , "enum@" , "type@" ,
@@ -1145,7 +1147,6 @@ impl Clean<Attributes> for [ast::Attribute] {
1145
1147
continue ;
1146
1148
}
1147
1149
1148
-
1149
1150
match kind {
1150
1151
PathKind :: Value => {
1151
1152
if let Ok ( def) = resolve ( cx, path_str, true ) {
@@ -1219,9 +1220,8 @@ impl Clean<Attributes> for [ast::Attribute] {
1219
1220
}
1220
1221
} ;
1221
1222
1222
-
1223
1223
let id = register_def ( cx, def) ;
1224
- attrs. links . push ( ( link , id, fragment) ) ;
1224
+ attrs. links . push ( ( ori_link , id, fragment) ) ;
1225
1225
}
1226
1226
1227
1227
cx. sess ( ) . abort_if_errors ( ) ;
0 commit comments