@@ -4,9 +4,8 @@ use crate::consts::{constant, Constant};
4
4
use crate :: utils:: paths;
5
5
use crate :: utils:: {
6
6
clip, comparisons, differing_macro_contexts, higher, in_constant, in_macro, int_bits, last_path_segment,
7
- match_def_path, match_path, multispan_sugg, opt_def_id, same_tys, sext, snippet, snippet_opt,
8
- snippet_with_applicability, span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, unsext,
9
- AbsolutePathBuffer ,
7
+ match_def_path, match_path, multispan_sugg, same_tys, sext, snippet, snippet_opt, snippet_with_applicability,
8
+ span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, unsext, AbsolutePathBuffer ,
10
9
} ;
11
10
use if_chain:: if_chain;
12
11
use rustc:: hir;
@@ -225,7 +224,7 @@ fn match_type_parameter(cx: &LateContext<'_, '_>, qpath: &QPath, path: &[&str])
225
224
_ => None ,
226
225
} ) ;
227
226
if let TyKind :: Path ( ref qpath) = ty. node;
228
- if let Some ( did) = opt_def_id ( cx. tables. qpath_def( qpath, ty. hir_id) ) ;
227
+ if let Some ( did) = cx. tables. qpath_def( qpath, ty. hir_id) . opt_def_id ( ) ;
229
228
if match_def_path( cx. tcx, did, path) ;
230
229
then {
231
230
return true ;
@@ -248,7 +247,7 @@ fn check_ty(cx: &LateContext<'_, '_>, hir_ty: &hir::Ty, is_local: bool) {
248
247
TyKind :: Path ( ref qpath) if !is_local => {
249
248
let hir_id = hir_ty. hir_id ;
250
249
let def = cx. tables . qpath_def ( qpath, hir_id) ;
251
- if let Some ( def_id) = opt_def_id ( def ) {
250
+ if let Some ( def_id) = def . opt_def_id ( ) {
252
251
if Some ( def_id) == cx. tcx . lang_items ( ) . owned_box ( ) {
253
252
if match_type_parameter ( cx, qpath, & paths:: VEC ) {
254
253
span_help_and_lint (
@@ -271,7 +270,7 @@ fn check_ty(cx: &LateContext<'_, '_>, hir_ty: &hir::Ty, is_local: bool) {
271
270
// ty is now _ at this point
272
271
if let TyKind :: Path ( ref ty_qpath) = ty. node;
273
272
let def = cx. tables. qpath_def( ty_qpath, ty. hir_id) ;
274
- if let Some ( def_id) = opt_def_id( def ) ;
273
+ if let Some ( def_id) = def . opt_def_id( ) ;
275
274
if Some ( def_id) == cx. tcx. lang_items( ) . owned_box( ) ;
276
275
// At this point, we know ty is Box<T>, now get T
277
276
if let Some ( ref last) = last_path_segment( ty_qpath) . args;
@@ -378,7 +377,7 @@ fn check_ty_rptr(cx: &LateContext<'_, '_>, hir_ty: &hir::Ty, is_local: bool, lt:
378
377
let hir_id = mut_ty. ty . hir_id ;
379
378
let def = cx. tables . qpath_def ( qpath, hir_id) ;
380
379
if_chain ! {
381
- if let Some ( def_id) = opt_def_id( def ) ;
380
+ if let Some ( def_id) = def . opt_def_id( ) ;
382
381
if Some ( def_id) == cx. tcx. lang_items( ) . owned_box( ) ;
383
382
if let QPath :: Resolved ( None , ref path) = * qpath;
384
383
if let [ ref bx] = * path. segments;
0 commit comments