Implemented #[doc(cfg(...))].
This attribute has two effects: 1. Items with this attribute and their children will have the "This is supported on **** only" message attached in the documentation. 2. The items' doc tests will be skipped if the configuration does not match.
This commit is contained in:
parent
8f935fbb5b
commit
a2b888675a
12 changed files with 1129 additions and 16 deletions
|
@ -1950,6 +1950,14 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
|
|||
stability.push(format!("<div class='stab deprecated'>{}</div>", text))
|
||||
}
|
||||
|
||||
if let Some(ref cfg) = item.attrs.cfg {
|
||||
stability.push(format!("<div class='stab portability'>{}</div>", if show_reason {
|
||||
cfg.render_long_html()
|
||||
} else {
|
||||
cfg.render_short_html()
|
||||
}));
|
||||
}
|
||||
|
||||
stability
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue