@@ -438,25 +438,25 @@ fn resolve_struct_error<'b, 'a: 'b, 'tcx: 'a>(resolver: &'b Resolver<'a, 'tcx>,
438
438
help_msg = format ! ( "To reference an item from the \
439
439
`{module}` module, use \
440
440
`{module}::{ident}`",
441
- module = & * path,
441
+ module = path,
442
442
ident = ident. node) ;
443
443
}
444
444
ExprMethodCall ( ident, _, _) => {
445
445
help_msg = format ! ( "To call a function from the \
446
446
`{module}` module, use \
447
447
`{module}::{ident}(..)`",
448
- module = & * path,
448
+ module = path,
449
449
ident = ident. node) ;
450
450
}
451
451
ExprCall ( _, _) => {
452
452
help_msg = format ! ( "No function corresponds to `{module}(..)`" ,
453
- module = & * path) ;
453
+ module = path) ;
454
454
}
455
455
_ => { } // no help available
456
456
}
457
457
} else {
458
458
help_msg = format ! ( "Module `{module}` cannot be the value of an expression" ,
459
- module = & * path) ;
459
+ module = path) ;
460
460
}
461
461
462
462
if !help_msg. is_empty ( ) {
@@ -577,7 +577,7 @@ impl<'a, 'v, 'tcx> Visitor<'v> for Resolver<'a, 'tcx> {
577
577
self . resolve_expr ( expr) ;
578
578
}
579
579
fn visit_local ( & mut self , local : & Local ) {
580
- execute_callback ! ( hir_map:: Node :: NodeLocal ( & * local. pat) , self ) ;
580
+ execute_callback ! ( hir_map:: Node :: NodeLocal ( & local. pat) , self ) ;
581
581
self . resolve_local ( local) ;
582
582
}
583
583
fn visit_ty ( & mut self , ty : & Ty ) {
@@ -1331,8 +1331,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1331
1331
match search_parent_externals ( name, & self . current_module ) {
1332
1332
Some ( module) => {
1333
1333
let path_str = names_to_string ( module_path) ;
1334
- let target_mod_str = module_to_string ( & * module) ;
1335
- let current_mod_str = module_to_string ( & * self . current_module ) ;
1334
+ let target_mod_str = module_to_string ( & module) ;
1335
+ let current_mod_str = module_to_string ( & self . current_module ) ;
1336
1336
1337
1337
let prefix = if target_mod_str == current_mod_str {
1338
1338
"self::" . to_string ( )
@@ -1400,7 +1400,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1400
1400
1401
1401
debug ! ( "(resolving module path for import) processing `{}` rooted at `{}`" ,
1402
1402
names_to_string( module_path) ,
1403
- module_to_string( & * module_) ) ;
1403
+ module_to_string( & module_) ) ;
1404
1404
1405
1405
// Resolve the module prefix, if any.
1406
1406
let module_prefix_result = self . resolve_module_prefix ( module_, module_path) ;
@@ -1494,15 +1494,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1494
1494
debug ! ( "(resolving item in lexical scope) resolving `{}` in namespace {:?} in `{}`" ,
1495
1495
name,
1496
1496
namespace,
1497
- module_to_string( & * module_) ) ;
1497
+ module_to_string( & module_) ) ;
1498
1498
1499
1499
// Proceed up the scope chain looking for parent modules.
1500
1500
let mut search_module = module_;
1501
1501
loop {
1502
1502
// Resolve the name in the parent module.
1503
1503
match self . resolve_name_in_module ( search_module, name, namespace, true , record_used) {
1504
1504
Failed ( Some ( ( span, msg) ) ) => {
1505
- resolve_error ( self , span, ResolutionError :: FailedToResolve ( & * msg) ) ;
1505
+ resolve_error ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
1506
1506
}
1507
1507
Failed ( None ) => ( ) , // Continue up the search chain.
1508
1508
Indeterminate => {
@@ -1592,7 +1592,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1592
1592
// Now loop through all the `super`s we find.
1593
1593
while i < module_path. len ( ) && "super" == module_path[ i] . as_str ( ) {
1594
1594
debug ! ( "(resolving module prefix) resolving `super` at {}" ,
1595
- module_to_string( & * containing_module) ) ;
1595
+ module_to_string( & containing_module) ) ;
1596
1596
match self . get_nearest_normal_module_parent ( containing_module) {
1597
1597
None => return Failed ( None ) ,
1598
1598
Some ( new_module) => {
@@ -1603,7 +1603,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1603
1603
}
1604
1604
1605
1605
debug ! ( "(resolving module prefix) finished resolving prefix at {}" ,
1606
- module_to_string( & * containing_module) ) ;
1606
+ module_to_string( & containing_module) ) ;
1607
1607
1608
1608
return Success ( PrefixFound ( containing_module, i) ) ;
1609
1609
}
@@ -1770,7 +1770,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1770
1770
ItemImpl ( _, _, ref generics, ref opt_trait_ref, ref self_type, ref impl_items) => {
1771
1771
self . resolve_implementation ( generics,
1772
1772
opt_trait_ref,
1773
- & * * self_type,
1773
+ & self_type,
1774
1774
item. id ,
1775
1775
impl_items) ;
1776
1776
}
@@ -1965,9 +1965,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1965
1965
// Add each argument to the rib.
1966
1966
let mut bindings_list = HashMap :: new ( ) ;
1967
1967
for argument in & declaration. inputs {
1968
- self . resolve_pattern ( & * argument. pat , ArgumentIrrefutableMode , & mut bindings_list) ;
1968
+ self . resolve_pattern ( & argument. pat , ArgumentIrrefutableMode , & mut bindings_list) ;
1969
1969
1970
- self . visit_ty ( & * argument. ty ) ;
1970
+ self . visit_ty ( & argument. ty ) ;
1971
1971
1972
1972
debug ! ( "(resolving function) recorded argument" ) ;
1973
1973
}
@@ -1997,7 +1997,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
1997
1997
let mut err =
1998
1998
resolve_struct_error ( self ,
1999
1999
trait_path. span ,
2000
- ResolutionError :: IsNotATrait ( & * path_names_to_string ( trait_path,
2000
+ ResolutionError :: IsNotATrait ( & path_names_to_string ( trait_path,
2001
2001
path_depth) ) ) ;
2002
2002
2003
2003
// If it's a typedef, give a note
@@ -2011,7 +2011,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2011
2011
} else {
2012
2012
resolve_error ( self ,
2013
2013
trait_path. span ,
2014
- ResolutionError :: UndeclaredTraitName ( & * path_names_to_string ( trait_path,
2014
+ ResolutionError :: UndeclaredTraitName ( & path_names_to_string ( trait_path,
2015
2015
path_depth) ) ) ;
2016
2016
Err ( ( ) )
2017
2017
}
@@ -2165,7 +2165,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2165
2165
if let Some ( ( did, ref trait_ref) ) = self . current_trait_ref {
2166
2166
if !self . trait_item_map . contains_key ( & ( name, did) ) {
2167
2167
let path_str = path_names_to_string ( & trait_ref. path , 0 ) ;
2168
- resolve_error ( self , span, err ( name, & * path_str) ) ;
2168
+ resolve_error ( self , span, err ( name, & path_str) ) ;
2169
2169
}
2170
2170
}
2171
2171
}
@@ -2178,7 +2178,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2178
2178
walk_list ! ( self , visit_expr, & local. init) ;
2179
2179
2180
2180
// Resolve the pattern.
2181
- self . resolve_pattern ( & * local. pat , LocalIrrefutableMode , & mut HashMap :: new ( ) ) ;
2181
+ self . resolve_pattern ( & local. pat , LocalIrrefutableMode , & mut HashMap :: new ( ) ) ;
2182
2182
}
2183
2183
2184
2184
// build a map from pattern identifiers to binding-info's.
@@ -2204,9 +2204,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2204
2204
if arm. pats . is_empty ( ) {
2205
2205
return ;
2206
2206
}
2207
- let map_0 = self . binding_mode_map ( & * arm. pats [ 0 ] ) ;
2207
+ let map_0 = self . binding_mode_map ( & arm. pats [ 0 ] ) ;
2208
2208
for ( i, p) in arm. pats . iter ( ) . enumerate ( ) {
2209
- let map_i = self . binding_mode_map ( & * * p) ;
2209
+ let map_i = self . binding_mode_map ( & p) ;
2210
2210
2211
2211
for ( & key, & binding_0) in & map_0 {
2212
2212
match map_i. get ( & key) {
@@ -2241,15 +2241,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2241
2241
2242
2242
let mut bindings_list = HashMap :: new ( ) ;
2243
2243
for pattern in & arm. pats {
2244
- self . resolve_pattern ( & * * pattern, RefutableMode , & mut bindings_list) ;
2244
+ self . resolve_pattern ( & pattern, RefutableMode , & mut bindings_list) ;
2245
2245
}
2246
2246
2247
2247
// This has to happen *after* we determine which
2248
2248
// pat_idents are variants
2249
2249
self . check_consistent_bindings ( arm) ;
2250
2250
2251
2251
walk_list ! ( self , visit_expr, & arm. guard) ;
2252
- self . visit_expr ( & * arm. body ) ;
2252
+ self . visit_expr ( & arm. body ) ;
2253
2253
2254
2254
if !self . resolved {
2255
2255
self . value_ribs . pop ( ) ;
@@ -2340,7 +2340,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2340
2340
ty. span ,
2341
2341
ResolutionError :: UseOfUndeclared (
2342
2342
kind,
2343
- & * path_names_to_string ( path,
2343
+ & path_names_to_string ( path,
2344
2344
0 ) )
2345
2345
) ;
2346
2346
}
@@ -2616,7 +2616,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2616
2616
self ,
2617
2617
path. span ,
2618
2618
ResolutionError :: DoesNotNameAStruct (
2619
- & * path_names_to_string ( path, 0 ) )
2619
+ & path_names_to_string ( path, 0 ) )
2620
2620
) ;
2621
2621
self . record_def ( pattern. id , err_path_resolution ( ) ) ;
2622
2622
}
@@ -2672,7 +2672,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2672
2672
Failed ( err) => {
2673
2673
match err {
2674
2674
Some ( ( span, msg) ) => {
2675
- resolve_error ( self , span, ResolutionError :: FailedToResolve ( & * msg) ) ;
2675
+ resolve_error ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
2676
2676
}
2677
2677
None => ( ) ,
2678
2678
}
@@ -2804,7 +2804,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2804
2804
match self . resolve_item_in_lexical_scope ( module, name, namespace, record_used) {
2805
2805
Success ( binding) => binding. def ( ) . map ( LocalDef :: from_def) ,
2806
2806
Failed ( Some ( ( span, msg) ) ) => {
2807
- resolve_error ( self , span, ResolutionError :: FailedToResolve ( & * msg) ) ;
2807
+ resolve_error ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
2808
2808
None
2809
2809
}
2810
2810
_ => None ,
@@ -2927,7 +2927,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2927
2927
}
2928
2928
} ;
2929
2929
2930
- resolve_error ( self , span, ResolutionError :: FailedToResolve ( & * msg) ) ;
2930
+ resolve_error ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
2931
2931
return None ;
2932
2932
}
2933
2933
Indeterminate => return None ,
@@ -2982,7 +2982,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2982
2982
}
2983
2983
} ;
2984
2984
2985
- resolve_error ( self , span, ResolutionError :: FailedToResolve ( & * msg) ) ;
2985
+ resolve_error ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
2986
2986
return None ;
2987
2987
}
2988
2988
@@ -3064,8 +3064,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
3064
3064
-> Option < ( Path , NodeId , FallbackChecks ) > {
3065
3065
match t. node {
3066
3066
TyPath ( None , ref path) => Some ( ( path. clone ( ) , t. id , allow) ) ,
3067
- TyPtr ( ref mut_ty) => extract_path_and_node_id ( & * mut_ty. ty , OnlyTraitAndStatics ) ,
3068
- TyRptr ( _, ref mut_ty) => extract_path_and_node_id ( & * mut_ty. ty , allow) ,
3067
+ TyPtr ( ref mut_ty) => extract_path_and_node_id ( & mut_ty. ty , OnlyTraitAndStatics ) ,
3068
+ TyRptr ( _, ref mut_ty) => extract_path_and_node_id ( & mut_ty. ty , allow) ,
3069
3069
// This doesn't handle the remaining `Ty` variants as they are not
3070
3070
// that commonly the self_type, it might be interesting to provide
3071
3071
// support for those in future.
@@ -3183,7 +3183,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
3183
3183
. flat_map ( |rib| rib. bindings . keys ( ) ) ;
3184
3184
3185
3185
if let Some ( found) = find_best_match_for_name ( names, name, None ) {
3186
- if name != & * found {
3186
+ if name != found {
3187
3187
return SuggestionType :: Function ( found) ;
3188
3188
}
3189
3189
} SuggestionType :: NotFound
@@ -3229,7 +3229,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
3229
3229
3230
3230
let mut err = resolve_struct_error ( self ,
3231
3231
expr. span ,
3232
- ResolutionError :: StructVariantUsedAsFunction ( & * path_name) ) ;
3232
+ ResolutionError :: StructVariantUsedAsFunction ( & path_name) ) ;
3233
3233
3234
3234
let msg = format ! ( "did you mean to write: `{} {{ /* fields */ }}`?" ,
3235
3235
path_name) ;
@@ -3270,7 +3270,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
3270
3270
Some ( Def :: Struct ( ..) ) => {
3271
3271
let mut err = resolve_struct_error ( self ,
3272
3272
expr. span ,
3273
- ResolutionError :: StructVariantUsedAsFunction ( & * path_name) ) ;
3273
+ ResolutionError :: StructVariantUsedAsFunction ( & path_name) ) ;
3274
3274
3275
3275
let msg = format ! ( "did you mean to write: `{} {{ /* fields */ }}`?" ,
3276
3276
path_name) ;
@@ -3346,7 +3346,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
3346
3346
resolve_error ( self ,
3347
3347
expr. span ,
3348
3348
ResolutionError :: UnresolvedName (
3349
- & * path_name, & * msg, context) ) ;
3349
+ & path_name, & msg, context) ) ;
3350
3350
}
3351
3351
}
3352
3352
}
@@ -3367,7 +3367,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
3367
3367
resolve_error ( self ,
3368
3368
path. span ,
3369
3369
ResolutionError :: DoesNotNameAStruct (
3370
- & * path_names_to_string ( path, 0 ) )
3370
+ & path_names_to_string ( path, 0 ) )
3371
3371
) ;
3372
3372
self . record_def ( expr. id , err_path_resolution ( ) ) ;
3373
3373
}
0 commit comments