4
4
5
5
use std:: sync:: Arc ;
6
6
7
- use hir_def:: {
8
- expr:: Statement , path:: path, resolver:: HasResolver , type_ref:: Mutability , AssocItemId ,
9
- DefWithBodyId , HasModule ,
10
- } ;
7
+ use hir_def:: { path:: path, resolver:: HasResolver , AssocItemId , DefWithBodyId , HasModule } ;
11
8
use hir_expand:: name;
12
9
use itertools:: Either ;
13
10
use rustc_hash:: FxHashSet ;
@@ -20,7 +17,7 @@ use crate::{
20
17
deconstruct_pat:: DeconstructedPat ,
21
18
usefulness:: { compute_match_usefulness, MatchCheckCtx } ,
22
19
} ,
23
- AdtId , InferenceResult , Interner , Ty , TyExt , TyKind ,
20
+ InferenceResult , Interner , TyExt ,
24
21
} ;
25
22
26
23
pub ( crate ) use hir_def:: {
@@ -428,30 +425,3 @@ fn types_of_subpatterns_do_match(pat: PatId, body: &Body, infer: &InferenceResul
428
425
walk ( pat, body, infer, & mut has_type_mismatches) ;
429
426
!has_type_mismatches
430
427
}
431
-
432
- fn check_missing_refs (
433
- infer : & InferenceResult ,
434
- arg : ExprId ,
435
- param : & Ty ,
436
- ) -> Option < ( ExprId , Mutability ) > {
437
- let arg_ty = infer. type_of_expr . get ( arg) ?;
438
-
439
- let reference_one = arg_ty. as_reference ( ) ;
440
- let reference_two = param. as_reference ( ) ;
441
-
442
- match ( reference_one, reference_two) {
443
- ( None , Some ( ( referenced_ty, _, mutability) ) ) if referenced_ty == arg_ty => {
444
- Some ( ( arg, Mutability :: from_mutable ( matches ! ( mutability, chalk_ir:: Mutability :: Mut ) ) ) )
445
- }
446
- ( None , Some ( ( referenced_ty, _, mutability) ) ) => match referenced_ty. kind ( Interner ) {
447
- TyKind :: Slice ( subst) if matches ! ( arg_ty. kind( Interner ) , TyKind :: Array ( arr_subst, _) if arr_subst == subst) => {
448
- Some ( (
449
- arg,
450
- Mutability :: from_mutable ( matches ! ( mutability, chalk_ir:: Mutability :: Mut ) ) ,
451
- ) )
452
- }
453
- _ => None ,
454
- } ,
455
- _ => None ,
456
- }
457
- }
0 commit comments