mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
rustdoc: mark ffi functions with unsafety icon
This commit is contained in:
parent
8921707653
commit
fe324cea64
@ -1806,12 +1806,13 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
|
|||||||
String::new()
|
String::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut unsafety_flag = "";
|
let unsafety_flag = match myitem.inner {
|
||||||
if let clean::FunctionItem(ref func) = myitem.inner {
|
clean::FunctionItem(ref func) | clean::ForeignFunctionItem(ref func)
|
||||||
if func.unsafety == hir::Unsafety::Unsafe {
|
if func.unsafety == hir::Unsafety::Unsafe => {
|
||||||
unsafety_flag = "<a title='unsafe function' href='#'><sup>⚠</sup></a>";
|
"<a title='unsafe function' href='#'><sup>⚠</sup></a>"
|
||||||
}
|
}
|
||||||
}
|
_ => "",
|
||||||
|
};
|
||||||
|
|
||||||
let doc_value = myitem.doc_value().unwrap_or("");
|
let doc_value = myitem.doc_value().unwrap_or("");
|
||||||
write!(w, "
|
write!(w, "
|
||||||
|
Loading…
Reference in New Issue
Block a user