@@ -53,7 +53,7 @@ const ATOMIC_TYPES: [&str; 12] = [
53
53
] ;
54
54
55
55
fn type_is_atomic ( cx : & LateContext < ' _ , ' _ > , expr : & Expr < ' _ > ) -> bool {
56
- if let ty:: Adt ( & ty:: AdtDef { did, .. } , _) = cx. tables . expr_ty ( expr) . kind {
56
+ if let ty:: Adt ( & ty:: AdtDef { did, .. } , _) = cx. tables ( ) . expr_ty ( expr) . kind {
57
57
ATOMIC_TYPES
58
58
. iter ( )
59
59
. any ( |ty| match_def_path ( cx, did, & [ "core" , "sync" , "atomic" , ty] ) )
@@ -76,7 +76,7 @@ fn check_atomic_load_store(cx: &LateContext<'_, '_>, expr: &Expr<'_>) {
76
76
if method == "load" || method == "store" ;
77
77
let ordering_arg = if method == "load" { & args[ 1 ] } else { & args[ 2 ] } ;
78
78
if let ExprKind :: Path ( ref ordering_qpath) = ordering_arg. kind;
79
- if let Some ( ordering_def_id) = cx. tables. qpath_res( ordering_qpath, ordering_arg. hir_id) . opt_def_id( ) ;
79
+ if let Some ( ordering_def_id) = cx. tables( ) . qpath_res( ordering_qpath, ordering_arg. hir_id) . opt_def_id( ) ;
80
80
then {
81
81
if method == "load" &&
82
82
match_ordering_def_path( cx, ordering_def_id, & [ "Release" , "AcqRel" ] ) {
@@ -107,12 +107,12 @@ fn check_memory_fence(cx: &LateContext<'_, '_>, expr: &Expr<'_>) {
107
107
if_chain ! {
108
108
if let ExprKind :: Call ( ref func, ref args) = expr. kind;
109
109
if let ExprKind :: Path ( ref func_qpath) = func. kind;
110
- if let Some ( def_id) = cx. tables. qpath_res( func_qpath, func. hir_id) . opt_def_id( ) ;
110
+ if let Some ( def_id) = cx. tables( ) . qpath_res( func_qpath, func. hir_id) . opt_def_id( ) ;
111
111
if [ "fence" , "compiler_fence" ]
112
112
. iter( )
113
113
. any( |func| match_def_path( cx, def_id, & [ "core" , "sync" , "atomic" , func] ) ) ;
114
114
if let ExprKind :: Path ( ref ordering_qpath) = & args[ 0 ] . kind;
115
- if let Some ( ordering_def_id) = cx. tables. qpath_res( ordering_qpath, args[ 0 ] . hir_id) . opt_def_id( ) ;
115
+ if let Some ( ordering_def_id) = cx. tables( ) . qpath_res( ordering_qpath, args[ 0 ] . hir_id) . opt_def_id( ) ;
116
116
if match_ordering_def_path( cx, ordering_def_id, & [ "Relaxed" ] ) ;
117
117
then {
118
118
span_lint_and_help(
0 commit comments