1
Fork 0

Rename Unsafe to Safety

This commit is contained in:
Santiago Pastorino 2024-05-17 14:17:48 -03:00
parent 2d89cee625
commit 6b46a919e1
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
115 changed files with 460 additions and 494 deletions

View file

@ -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