@@ -112,7 +112,7 @@ impl IndexingSlicing {
112112impl < ' tcx > LateLintPass < ' tcx > for IndexingSlicing {
113113 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
114114 if let ExprKind :: Index ( array, index, _) = & expr. kind
115- && ( !self . suppress_restriction_lint_in_const || !cx. tcx . hir ( ) . is_inside_const_context ( expr. hir_id ) )
115+ && ( !self . suppress_restriction_lint_in_const || !cx. tcx . hir_is_inside_const_context ( expr. hir_id ) )
116116 && let expr_ty = cx. typeck_results ( ) . expr_ty ( array)
117117 && let mut deref = deref_chain ( cx, expr_ty)
118118 && deref. any ( |l| {
@@ -181,7 +181,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
181181 span_lint_and_then ( cx, INDEXING_SLICING , expr. span , "slicing may panic" , |diag| {
182182 diag. help ( help_msg) ;
183183
184- if cx. tcx . hir ( ) . is_inside_const_context ( expr. hir_id ) {
184+ if cx. tcx . hir_is_inside_const_context ( expr. hir_id ) {
185185 diag. note ( note) ;
186186 }
187187 } ) ;
@@ -223,7 +223,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
223223 span_lint_and_then ( cx, INDEXING_SLICING , expr. span , "indexing may panic" , |diag| {
224224 diag. help ( "consider using `.get(n)` or `.get_mut(n)` instead" ) ;
225225
226- if cx. tcx . hir ( ) . is_inside_const_context ( expr. hir_id ) {
226+ if cx. tcx . hir_is_inside_const_context ( expr. hir_id ) {
227227 diag. note ( note) ;
228228 }
229229 } ) ;
0 commit comments