@@ -185,7 +185,7 @@ fn is_mutable_pat(cx: &LateContext<'_>, pat: &hir::Pat<'_>, tys: &mut DefIdSet)
185
185
if let hir:: PatKind :: Wild = pat. kind {
186
186
return false ; // ignore `_` patterns
187
187
}
188
- if cx. tcx . has_typeck_results ( pat. hir_id . owner . to_def_id ( ) ) {
188
+ if cx. tcx . has_typeck_results ( pat. hir_id . owner . def_id ) {
189
189
is_mutable_ty ( cx, cx. tcx . typeck ( pat. hir_id . owner . def_id ) . pat_ty ( pat) , tys)
190
190
} else {
191
191
false
@@ -233,7 +233,7 @@ fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bo
233
233
Call ( _, args) => {
234
234
let mut tys = DefIdSet :: default ( ) ;
235
235
for arg in args {
236
- if cx. tcx . has_typeck_results ( arg. hir_id . owner . to_def_id ( ) )
236
+ if cx. tcx . has_typeck_results ( arg. hir_id . owner . def_id )
237
237
&& is_mutable_ty ( cx, cx. tcx . typeck ( arg. hir_id . owner . def_id ) . expr_ty ( arg) , & mut tys)
238
238
&& is_mutated_static ( arg)
239
239
{
@@ -246,7 +246,7 @@ fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bo
246
246
MethodCall ( _, receiver, args, _) => {
247
247
let mut tys = DefIdSet :: default ( ) ;
248
248
for arg in std:: iter:: once ( receiver) . chain ( args. iter ( ) ) {
249
- if cx. tcx . has_typeck_results ( arg. hir_id . owner . to_def_id ( ) )
249
+ if cx. tcx . has_typeck_results ( arg. hir_id . owner . def_id )
250
250
&& is_mutable_ty ( cx, cx. tcx . typeck ( arg. hir_id . owner . def_id ) . expr_ty ( arg) , & mut tys)
251
251
&& is_mutated_static ( arg)
252
252
{
0 commit comments