@@ -19,30 +19,30 @@ pub(super) fn check_fn<'tcx>(
1919 body : & ' tcx hir:: Body < ' tcx > ,
2020 def_id : LocalDefId ,
2121) {
22- let unsafety = match kind {
23- intravisit:: FnKind :: ItemFn ( _, _, hir:: FnHeader { unsafety , .. } ) => unsafety ,
24- intravisit:: FnKind :: Method ( _, sig) => sig. header . unsafety ,
22+ let safety = match kind {
23+ intravisit:: FnKind :: ItemFn ( _, _, hir:: FnHeader { safety , .. } ) => safety ,
24+ intravisit:: FnKind :: Method ( _, sig) => sig. header . safety ,
2525 intravisit:: FnKind :: Closure => return ,
2626 } ;
2727
28- check_raw_ptr ( cx, unsafety , decl, body, def_id) ;
28+ check_raw_ptr ( cx, safety , decl, body, def_id) ;
2929}
3030
3131pub ( super ) fn check_trait_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: TraitItem < ' _ > ) {
3232 if let hir:: TraitItemKind :: Fn ( ref sig, hir:: TraitFn :: Provided ( eid) ) = item. kind {
3333 let body = cx. tcx . hir ( ) . body ( eid) ;
34- check_raw_ptr ( cx, sig. header . unsafety , sig. decl , body, item. owner_id . def_id ) ;
34+ check_raw_ptr ( cx, sig. header . safety , sig. decl , body, item. owner_id . def_id ) ;
3535 }
3636}
3737
3838fn check_raw_ptr < ' tcx > (
3939 cx : & LateContext < ' tcx > ,
40- unsafety : hir:: Unsafety ,
40+ safety : hir:: Safety ,
4141 decl : & ' tcx hir:: FnDecl < ' tcx > ,
4242 body : & ' tcx hir:: Body < ' tcx > ,
4343 def_id : LocalDefId ,
4444) {
45- if unsafety == hir:: Unsafety :: Normal && cx. effective_visibilities . is_exported ( def_id) {
45+ if safety == hir:: Safety :: Safe && cx. effective_visibilities . is_exported ( def_id) {
4646 let raw_ptrs = iter_input_pats ( decl, body)
4747 . filter_map ( |arg| raw_ptr_arg ( cx, arg) )
4848 . collect :: < HirIdSet > ( ) ;
@@ -58,7 +58,7 @@ fn check_raw_ptr<'tcx>(
5858 } ,
5959 hir:: ExprKind :: MethodCall ( _, recv, args, _) => {
6060 let def_id = typeck. type_dependent_def_id ( e. hir_id ) . unwrap ( ) ;
61- if cx. tcx . fn_sig ( def_id) . skip_binder ( ) . skip_binder ( ) . unsafety == hir:: Unsafety :: Unsafe {
61+ if cx. tcx . fn_sig ( def_id) . skip_binder ( ) . skip_binder ( ) . safety == hir:: Safety :: Unsafe {
6262 check_arg ( cx, & raw_ptrs, recv) ;
6363 for arg in args {
6464 check_arg ( cx, & raw_ptrs, arg) ;
0 commit comments