Allow function@, value@, macro@

This commit is contained in:
Manish Goregaokar 2018-01-19 16:45:48 +05:30
parent 6a1a449220
commit 869dd91d44

View file

@ -862,13 +862,17 @@ impl Clean<Attributes> for [ast::Attribute] {
kind = PathKind::Type; kind = PathKind::Type;
link.trim_left_matches(prefix) link.trim_left_matches(prefix)
} else if let Some(prefix) = } else if let Some(prefix) =
["const@", "static@"].iter() ["const@", "static@",
.find(|p| link.starts_with(**p)) { "value@", "function@"].iter()
.find(|p| link.starts_with(**p)) {
kind = PathKind::Value; kind = PathKind::Value;
link.trim_left_matches(prefix) link.trim_left_matches(prefix)
} else if link.ends_with("()") { } else if link.ends_with("()") {
kind = PathKind::Value; kind = PathKind::Value;
link.trim_right_matches("()") link.trim_right_matches("()")
} else if link.starts_with("macro@") {
kind = PathKind::Macro;
link.trim_left_matches("macro@")
} else if link.ends_with('!') { } else if link.ends_with('!') {
kind = PathKind::Macro; kind = PathKind::Macro;
link.trim_right_matches('!') link.trim_right_matches('!')