This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-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 ,
Original file line number Diff line number Diff line change 1+ #![ feature( intrinsics) ]
2+ #![ feature( no_core) ]
3+
4+ #![ no_core]
5+ #![ crate_name = "foo" ]
6+
7+ extern "rust-intrinsic" {
8+ // @has 'foo/fn.abort.html'
9+ // @has - '//pre[@class="rust fn"]' 'pub extern "rust-intrinsic" fn abort() -> !'
10+ pub fn abort ( ) -> !;
11+ // @has 'foo/fn.unreachable.html'
12+ // @has - '//pre[@class="rust fn"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !'
13+ pub fn unreachable ( ) -> !;
14+ }
15+
16+ extern "C" {
17+ // @has 'foo/fn.needs_drop.html'
18+ // @has - '//pre[@class="rust fn"]' 'pub unsafe extern "C" fn needs_drop() -> !'
19+ pub fn needs_drop ( ) -> !;
20+ }
You can’t perform that action at this time.
0 commit comments