Don't mark "safe" intrinsics as unsafe
This commit is contained in:
parent
6936ca8c99
commit
91f491ecf2
1 changed files with 7 additions and 1 deletions
|
@ -26,6 +26,8 @@ use rustc_mir::const_eval::{is_const_fn, is_unstable_const_fn};
|
||||||
use rustc_span::hygiene::{AstPass, MacroKind};
|
use rustc_span::hygiene::{AstPass, MacroKind};
|
||||||
use rustc_span::symbol::{kw, sym, Ident, Symbol};
|
use rustc_span::symbol::{kw, sym, Ident, Symbol};
|
||||||
use rustc_span::{self, ExpnKind};
|
use rustc_span::{self, ExpnKind};
|
||||||
|
use rustc_target::spec::abi::Abi;
|
||||||
|
use rustc_typeck::check::intrinsic::intrinsic_operation_unsafety;
|
||||||
use rustc_typeck::hir_ty_to_ty;
|
use rustc_typeck::hir_ty_to_ty;
|
||||||
|
|
||||||
use std::collections::hash_map::Entry;
|
use std::collections::hash_map::Entry;
|
||||||
|
@ -2132,7 +2134,11 @@ impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Symbol>) {
|
||||||
decl,
|
decl,
|
||||||
generics,
|
generics,
|
||||||
header: hir::FnHeader {
|
header: hir::FnHeader {
|
||||||
unsafety: hir::Unsafety::Unsafe,
|
unsafety: if abi == Abi::RustIntrinsic {
|
||||||
|
intrinsic_operation_unsafety(item.ident.name)
|
||||||
|
} else {
|
||||||
|
hir::Unsafety::Unsafe
|
||||||
|
},
|
||||||
abi,
|
abi,
|
||||||
constness: hir::Constness::NotConst,
|
constness: hir::Constness::NotConst,
|
||||||
asyncness: hir::IsAsync::NotAsync,
|
asyncness: hir::IsAsync::NotAsync,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue