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

@ -205,9 +205,9 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
if self_ty.is_fn() {
let fn_sig = self_ty.fn_sig(self.tcx);
let shortname = match fn_sig.unsafety() {
hir::Unsafety::Normal => "fn",
hir::Unsafety::Unsafe => "unsafe fn",
let shortname = match fn_sig.safety() {
hir::Safety::Safe => "fn",
hir::Safety::Unsafe => "unsafe fn",
};
flags.push((sym::_Self, Some(shortname.to_owned())));
}

View file

@ -1897,7 +1897,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
*inputs,
infcx.next_ty_var(DUMMY_SP),
false,
hir::Unsafety::Normal,
hir::Safety::Safe,
abi::Abi::Rust,
)
}
@ -1905,7 +1905,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
[inputs],
infcx.next_ty_var(DUMMY_SP),
false,
hir::Unsafety::Normal,
hir::Safety::Safe,
abi::Abi::Rust,
),
};
@ -3925,7 +3925,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
&& let fn_sig @ ty::FnSig {
abi: abi::Abi::Rust,
c_variadic: false,
unsafety: hir::Unsafety::Normal,
safety: hir::Safety::Safe,
..
} = fn_ty.fn_sig(tcx).skip_binder()

View file

@ -1712,7 +1712,7 @@ fn confirm_closure_candidate<'cx, 'tcx>(
[sig.tupled_inputs_ty],
output_ty,
sig.c_variadic,
sig.unsafety,
sig.safety,
sig.abi,
)
})