@@ -144,7 +144,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxPointers {
144144 }
145145
146146 fn check_expr ( & mut self , cx : & LateContext < ' _ , ' _ > , e : & hir:: Expr < ' _ > ) {
147- let ty = cx. tables . node_type ( e. hir_id ) ;
147+ let ty = cx. tables ( ) . node_type ( e. hir_id ) ;
148148 self . check_heap_type ( cx, e. span , ty) ;
149149 }
150150}
@@ -161,11 +161,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonShorthandFieldPatterns {
161161 fn check_pat ( & mut self , cx : & LateContext < ' _ , ' _ > , pat : & hir:: Pat < ' _ > ) {
162162 if let PatKind :: Struct ( ref qpath, field_pats, _) = pat. kind {
163163 let variant = cx
164- . tables
164+ . tables ( )
165165 . pat_ty ( pat)
166166 . ty_adt_def ( )
167167 . expect ( "struct pattern type is not an ADT" )
168- . variant_of_res ( cx. tables . qpath_res ( qpath, pat. hir_id ) ) ;
168+ . variant_of_res ( cx. tables ( ) . qpath_res ( qpath, pat. hir_id ) ) ;
169169 for fieldpat in field_pats {
170170 if fieldpat. is_shorthand {
171171 continue ;
@@ -178,7 +178,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonShorthandFieldPatterns {
178178 }
179179 if let PatKind :: Binding ( binding_annot, _, ident, None ) = fieldpat. pat . kind {
180180 if cx. tcx . find_field_index ( ident, & variant)
181- == Some ( cx. tcx . field_index ( fieldpat. hir_id , cx. tables ) )
181+ == Some ( cx. tcx . field_index ( fieldpat. hir_id , cx. tables ( ) ) )
182182 {
183183 cx. struct_span_lint ( NON_SHORTHAND_FIELD_PATTERNS , fieldpat. span , |lint| {
184184 let mut err = lint
@@ -901,15 +901,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MutableTransmutes {
901901 expr : & hir:: Expr < ' _ > ,
902902 ) -> Option < ( Ty < ' tcx > , Ty < ' tcx > ) > {
903903 let def = if let hir:: ExprKind :: Path ( ref qpath) = expr. kind {
904- cx. tables . qpath_res ( qpath, expr. hir_id )
904+ cx. tables ( ) . qpath_res ( qpath, expr. hir_id )
905905 } else {
906906 return None ;
907907 } ;
908908 if let Res :: Def ( DefKind :: Fn , did) = def {
909909 if !def_id_is_transmute ( cx, did) {
910910 return None ;
911911 }
912- let sig = cx. tables . node_type ( expr. hir_id ) . fn_sig ( cx. tcx ) ;
912+ let sig = cx. tables ( ) . node_type ( expr. hir_id ) . fn_sig ( cx. tcx ) ;
913913 let from = sig. inputs ( ) . skip_binder ( ) [ 0 ] ;
914914 let to = * sig. output ( ) . skip_binder ( ) ;
915915 return Some ( ( from, to) ) ;
@@ -1891,7 +1891,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
18911891 if let hir:: ExprKind :: Call ( ref path_expr, ref args) = expr. kind {
18921892 // Find calls to `mem::{uninitialized,zeroed}` methods.
18931893 if let hir:: ExprKind :: Path ( ref qpath) = path_expr. kind {
1894- let def_id = cx. tables . qpath_res ( qpath, path_expr. hir_id ) . opt_def_id ( ) ?;
1894+ let def_id = cx. tables ( ) . qpath_res ( qpath, path_expr. hir_id ) . opt_def_id ( ) ?;
18951895
18961896 if cx. tcx . is_diagnostic_item ( sym:: mem_zeroed, def_id) {
18971897 return Some ( InitKind :: Zeroed ) ;
@@ -1905,14 +1905,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
19051905 }
19061906 } else if let hir:: ExprKind :: MethodCall ( _, _, ref args, _) = expr. kind {
19071907 // Find problematic calls to `MaybeUninit::assume_init`.
1908- let def_id = cx. tables . type_dependent_def_id ( expr. hir_id ) ?;
1908+ let def_id = cx. tables ( ) . type_dependent_def_id ( expr. hir_id ) ?;
19091909 if cx. tcx . is_diagnostic_item ( sym:: assume_init, def_id) {
19101910 // This is a call to *some* method named `assume_init`.
19111911 // See if the `self` parameter is one of the dangerous constructors.
19121912 if let hir:: ExprKind :: Call ( ref path_expr, _) = args[ 0 ] . kind {
19131913 if let hir:: ExprKind :: Path ( ref qpath) = path_expr. kind {
19141914 let def_id =
1915- cx. tables . qpath_res ( qpath, path_expr. hir_id ) . opt_def_id ( ) ?;
1915+ cx. tables ( ) . qpath_res ( qpath, path_expr. hir_id ) . opt_def_id ( ) ?;
19161916
19171917 if cx. tcx . is_diagnostic_item ( sym:: maybe_uninit_zeroed, def_id) {
19181918 return Some ( InitKind :: Zeroed ) ;
@@ -2025,7 +2025,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue {
20252025 // This conjures an instance of a type out of nothing,
20262026 // using zeroed or uninitialized memory.
20272027 // We are extremely conservative with what we warn about.
2028- let conjured_ty = cx. tables . expr_ty ( expr) ;
2028+ let conjured_ty = cx. tables ( ) . expr_ty ( expr) ;
20292029 if let Some ( ( msg, span) ) = ty_find_init_error ( cx. tcx , conjured_ty, init) {
20302030 cx. struct_span_lint ( INVALID_VALUE , expr. span , |lint| {
20312031 let mut err = lint. build ( & format ! (
0 commit comments