Rename Unsafe to Safety
This commit is contained in:
parent
2d89cee625
commit
6b46a919e1
115 changed files with 460 additions and 494 deletions
|
@ -391,7 +391,7 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> {
|
|||
return; // don't visit the whole expression
|
||||
}
|
||||
ExprKind::Call { fun, ty: _, args: _, from_hir_call: _, fn_span: _ } => {
|
||||
if self.thir[fun].ty.fn_sig(self.tcx).unsafety() == hir::Unsafety::Unsafe {
|
||||
if self.thir[fun].ty.fn_sig(self.tcx).safety() == hir::Safety::Unsafe {
|
||||
let func_id = if let ty::FnDef(func_id, _) = self.thir[fun].ty.kind() {
|
||||
Some(*func_id)
|
||||
} else {
|
||||
|
@ -921,7 +921,7 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) {
|
|||
|
||||
let hir_id = tcx.local_def_id_to_hir_id(def);
|
||||
let safety_context = tcx.hir().fn_sig_by_hir_id(hir_id).map_or(SafetyContext::Safe, |fn_sig| {
|
||||
if fn_sig.header.unsafety == hir::Unsafety::Unsafe {
|
||||
if fn_sig.header.safety == hir::Safety::Unsafe {
|
||||
SafetyContext::UnsafeFn
|
||||
} else {
|
||||
SafetyContext::Safe
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue