File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ use rustc_mir::const_eval::{is_const_fn, is_unstable_const_fn};
2626use rustc_span:: hygiene:: { AstPass , MacroKind } ;
2727use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
2828use rustc_span:: { self , ExpnKind } ;
29+ use rustc_target:: spec:: abi:: Abi ;
30+ use rustc_typeck:: check:: intrinsic:: intrinsic_operation_unsafety;
2931use rustc_typeck:: hir_ty_to_ty;
3032
3133use std:: collections:: hash_map:: Entry ;
@@ -2132,7 +2134,11 @@ impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Symbol>) {
21322134 decl,
21332135 generics,
21342136 header : hir:: FnHeader {
2135- unsafety : hir:: Unsafety :: Unsafe ,
2137+ unsafety : if abi == Abi :: RustIntrinsic {
2138+ intrinsic_operation_unsafety ( item. ident . name )
2139+ } else {
2140+ hir:: Unsafety :: Unsafe
2141+ } ,
21362142 abi,
21372143 constness : hir:: Constness :: NotConst ,
21382144 asyncness : hir:: IsAsync :: NotAsync ,
You can’t perform that action at this time.
0 commit comments