@@ -112,7 +112,7 @@ impl IndexingSlicing {
112
112
impl < ' tcx > LateLintPass < ' tcx > for IndexingSlicing {
113
113
fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' _ > ) {
114
114
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 ) )
116
116
&& let expr_ty = cx. typeck_results ( ) . expr_ty ( array)
117
117
&& let mut deref = deref_chain ( cx, expr_ty)
118
118
&& deref. any ( |l| {
@@ -181,7 +181,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
181
181
span_lint_and_then ( cx, INDEXING_SLICING , expr. span , "slicing may panic" , |diag| {
182
182
diag. help ( help_msg) ;
183
183
184
- if cx. tcx . hir ( ) . is_inside_const_context ( expr. hir_id ) {
184
+ if cx. tcx . hir_is_inside_const_context ( expr. hir_id ) {
185
185
diag. note ( note) ;
186
186
}
187
187
} ) ;
@@ -223,7 +223,7 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
223
223
span_lint_and_then ( cx, INDEXING_SLICING , expr. span , "indexing may panic" , |diag| {
224
224
diag. help ( "consider using `.get(n)` or `.get_mut(n)` instead" ) ;
225
225
226
- if cx. tcx . hir ( ) . is_inside_const_context ( expr. hir_id ) {
226
+ if cx. tcx . hir_is_inside_const_context ( expr. hir_id ) {
227
227
diag. note ( note) ;
228
228
}
229
229
} ) ;
0 commit comments