@@ -19,30 +19,30 @@ pub(super) fn check_fn<'tcx>(
19
19
body : & ' tcx hir:: Body < ' tcx > ,
20
20
def_id : LocalDefId ,
21
21
) {
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 ,
25
25
intravisit:: FnKind :: Closure => return ,
26
26
} ;
27
27
28
- check_raw_ptr ( cx, unsafety , decl, body, def_id) ;
28
+ check_raw_ptr ( cx, safety , decl, body, def_id) ;
29
29
}
30
30
31
31
pub ( super ) fn check_trait_item < ' tcx > ( cx : & LateContext < ' tcx > , item : & ' tcx hir:: TraitItem < ' _ > ) {
32
32
if let hir:: TraitItemKind :: Fn ( ref sig, hir:: TraitFn :: Provided ( eid) ) = item. kind {
33
33
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 ) ;
35
35
}
36
36
}
37
37
38
38
fn check_raw_ptr < ' tcx > (
39
39
cx : & LateContext < ' tcx > ,
40
- unsafety : hir:: Unsafety ,
40
+ safety : hir:: Safety ,
41
41
decl : & ' tcx hir:: FnDecl < ' tcx > ,
42
42
body : & ' tcx hir:: Body < ' tcx > ,
43
43
def_id : LocalDefId ,
44
44
) {
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) {
46
46
let raw_ptrs = iter_input_pats ( decl, body)
47
47
. filter_map ( |arg| raw_ptr_arg ( cx, arg) )
48
48
. collect :: < HirIdSet > ( ) ;
@@ -58,7 +58,7 @@ fn check_raw_ptr<'tcx>(
58
58
} ,
59
59
hir:: ExprKind :: MethodCall ( _, recv, args, _) => {
60
60
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 {
62
62
check_arg ( cx, & raw_ptrs, recv) ;
63
63
for arg in args {
64
64
check_arg ( cx, & raw_ptrs, arg) ;
0 commit comments