@@ -126,9 +126,9 @@ pub fn lower_crate(sess: &Session,
126
126
127
127
LoweringContext {
128
128
crate_root : std_inject:: injected_crate_name ( krate) ,
129
- sess : sess ,
129
+ sess,
130
130
parent_def : None ,
131
- resolver : resolver ,
131
+ resolver,
132
132
name_map : FxHashMap ( ) ,
133
133
items : BTreeMap :: new ( ) ,
134
134
trait_items : BTreeMap :: new ( ) ,
@@ -251,15 +251,15 @@ impl<'a> LoweringContext<'a> {
251
251
. init_node_id_to_hir_id_mapping ( self . node_id_to_hir_id ) ;
252
252
253
253
hir:: Crate {
254
- module : module ,
255
- attrs : attrs ,
254
+ module,
255
+ attrs,
256
256
span : c. span ,
257
257
exported_macros : hir:: HirVec :: from ( self . exported_macros ) ,
258
258
items : self . items ,
259
259
trait_items : self . trait_items ,
260
260
impl_items : self . impl_items ,
261
261
bodies : self . bodies ,
262
- body_ids : body_ids ,
262
+ body_ids,
263
263
trait_impls : self . trait_impls ,
264
264
trait_default_impl : self . trait_default_impl ,
265
265
}
@@ -368,7 +368,7 @@ impl<'a> LoweringContext<'a> {
368
368
arguments : decl. map_or ( hir_vec ! [ ] , |decl| {
369
369
decl. inputs . iter ( ) . map ( |x| self . lower_arg ( x) ) . collect ( )
370
370
} ) ,
371
- value : value
371
+ value,
372
372
} ;
373
373
let id = body. id ( ) ;
374
374
self . bodies . insert ( id, body) ;
@@ -809,7 +809,7 @@ impl<'a> LoweringContext<'a> {
809
809
self . lower_path_segment ( p. span , segment, param_mode, 0 )
810
810
} ) . chain ( name. map ( |name| {
811
811
hir:: PathSegment {
812
- name : name ,
812
+ name,
813
813
parameters : hir:: PathParameters :: none ( )
814
814
}
815
815
} ) ) . collect ( ) ,
@@ -857,7 +857,7 @@ impl<'a> LoweringContext<'a> {
857
857
858
858
hir:: PathSegment {
859
859
name : self . lower_ident ( segment. identifier ) ,
860
- parameters : parameters ,
860
+ parameters,
861
861
}
862
862
}
863
863
@@ -881,7 +881,7 @@ impl<'a> LoweringContext<'a> {
881
881
hir:: ParenthesizedParameterData {
882
882
inputs : inputs. iter ( ) . map ( |ty| self . lower_ty ( ty) ) . collect ( ) ,
883
883
output : output. as_ref ( ) . map ( |ty| self . lower_ty ( ty) ) ,
884
- span : span ,
884
+ span,
885
885
}
886
886
}
887
887
@@ -970,8 +970,8 @@ impl<'a> LoweringContext<'a> {
970
970
971
971
hir:: TyParam {
972
972
id : self . lower_node_id ( tp. id ) ,
973
- name : name ,
974
- bounds : bounds ,
973
+ name,
974
+ bounds,
975
975
default : tp. default . as_ref ( ) . map ( |x| self . lower_ty ( x) ) ,
976
976
span : tp. span ,
977
977
pure_wrt_drop : tp. attrs . iter ( ) . any ( |attr| attr. check_name ( "may_dangle" ) ) ,
@@ -1081,14 +1081,14 @@ impl<'a> LoweringContext<'a> {
1081
1081
TraitTyParamBound ( _, TraitBoundModifier :: Maybe ) => None ,
1082
1082
_ => Some ( self . lower_ty_param_bound ( bound) )
1083
1083
} ) . collect ( ) ,
1084
- span : span ,
1084
+ span,
1085
1085
} )
1086
1086
}
1087
1087
WherePredicate :: RegionPredicate ( WhereRegionPredicate { ref lifetime,
1088
1088
ref bounds,
1089
1089
span} ) => {
1090
1090
hir:: WherePredicate :: RegionPredicate ( hir:: WhereRegionPredicate {
1091
- span : span ,
1091
+ span,
1092
1092
lifetime : self . lower_lifetime ( lifetime) ,
1093
1093
bounds : bounds. iter ( ) . map ( |bound| self . lower_lifetime ( bound) ) . collect ( ) ,
1094
1094
} )
@@ -1101,7 +1101,7 @@ impl<'a> LoweringContext<'a> {
1101
1101
id : self . lower_node_id ( id) ,
1102
1102
lhs_ty : self . lower_ty ( lhs_ty) ,
1103
1103
rhs_ty : self . lower_ty ( rhs_ty) ,
1104
- span : span ,
1104
+ span,
1105
1105
} )
1106
1106
}
1107
1107
}
@@ -1133,7 +1133,7 @@ impl<'a> LoweringContext<'a> {
1133
1133
qpath => bug ! ( "lower_trait_ref: unexpected QPath `{:?}`" , qpath)
1134
1134
} ;
1135
1135
hir:: TraitRef {
1136
- path : path ,
1136
+ path,
1137
1137
ref_id : self . lower_node_id ( p. ref_id ) ,
1138
1138
}
1139
1139
}
@@ -1201,10 +1201,10 @@ impl<'a> LoweringContext<'a> {
1201
1201
P ( hir:: Block {
1202
1202
id : self . lower_node_id ( b. id ) ,
1203
1203
stmts : stmts. into ( ) ,
1204
- expr : expr ,
1204
+ expr,
1205
1205
rules : self . lower_block_check_mode ( & b. rules ) ,
1206
1206
span : b. span ,
1207
- targeted_by_break : targeted_by_break ,
1207
+ targeted_by_break,
1208
1208
} )
1209
1209
}
1210
1210
@@ -1259,8 +1259,8 @@ impl<'a> LoweringContext<'a> {
1259
1259
name : import. rename . unwrap_or ( ident) . name ,
1260
1260
attrs : attrs. clone ( ) ,
1261
1261
node : hir:: ItemUse ( P ( path) , hir:: UseKind :: Single ) ,
1262
- vis : vis ,
1263
- span : span ,
1262
+ vis,
1263
+ span,
1264
1264
} ) ;
1265
1265
} ) ;
1266
1266
}
@@ -1441,7 +1441,7 @@ impl<'a> LoweringContext<'a> {
1441
1441
name : self . lower_ident ( i. ident ) ,
1442
1442
span : i. span ,
1443
1443
defaultness : self . lower_defaultness ( Defaultness :: Default , has_default) ,
1444
- kind : kind ,
1444
+ kind,
1445
1445
}
1446
1446
}
1447
1447
@@ -1523,9 +1523,9 @@ impl<'a> LoweringContext<'a> {
1523
1523
if let ItemKind :: MacroDef ( ref def) = i. node {
1524
1524
if !def. legacy || i. attrs . iter ( ) . any ( |attr| attr. path == "macro_export" ) {
1525
1525
self . exported_macros . push ( hir:: MacroDef {
1526
- name : name ,
1527
- vis : vis ,
1528
- attrs : attrs ,
1526
+ name,
1527
+ vis,
1528
+ attrs,
1529
1529
id : i. id ,
1530
1530
span : i. span ,
1531
1531
body : def. stream ( ) ,
@@ -1541,10 +1541,10 @@ impl<'a> LoweringContext<'a> {
1541
1541
1542
1542
Some ( hir:: Item {
1543
1543
id : self . lower_node_id ( i. id ) ,
1544
- name : name ,
1545
- attrs : attrs ,
1546
- node : node ,
1547
- vis : vis ,
1544
+ name,
1545
+ attrs,
1546
+ node,
1547
+ vis,
1548
1548
span : i. span ,
1549
1549
} )
1550
1550
}
@@ -1650,7 +1650,7 @@ impl<'a> LoweringContext<'a> {
1650
1650
Some ( def) => {
1651
1651
hir:: PatKind :: Path ( hir:: QPath :: Resolved ( None , P ( hir:: Path {
1652
1652
span : pth1. span ,
1653
- def : def ,
1653
+ def,
1654
1654
segments : hir_vec ! [
1655
1655
hir:: PathSegment :: from_name( pth1. node. name)
1656
1656
] ,
@@ -1887,9 +1887,9 @@ impl<'a> LoweringContext<'a> {
1887
1887
let blk = P ( hir:: Block {
1888
1888
stmts : hir_vec ! [ ] ,
1889
1889
expr : Some ( els) ,
1890
- id : id ,
1890
+ id,
1891
1891
rules : hir:: DefaultBlock ,
1892
- span : span ,
1892
+ span,
1893
1893
targeted_by_break : false ,
1894
1894
} ) ;
1895
1895
P ( self . expr_block ( blk, ThinVec :: new ( ) ) )
@@ -2108,7 +2108,7 @@ impl<'a> LoweringContext<'a> {
2108
2108
sub_expr,
2109
2109
arms. into ( ) ,
2110
2110
hir:: MatchSource :: IfLetDesugar {
2111
- contains_else_clause : contains_else_clause ,
2111
+ contains_else_clause,
2112
2112
} )
2113
2113
}
2114
2114
@@ -2536,7 +2536,7 @@ impl<'a> LoweringContext<'a> {
2536
2536
fn arm ( & mut self , pats : hir:: HirVec < P < hir:: Pat > > , expr : P < hir:: Expr > ) -> hir:: Arm {
2537
2537
hir:: Arm {
2538
2538
attrs : hir_vec ! [ ] ,
2539
- pats : pats ,
2539
+ pats,
2540
2540
guard : None ,
2541
2541
body : expr,
2542
2542
}
@@ -2546,10 +2546,10 @@ impl<'a> LoweringContext<'a> {
2546
2546
hir:: Field {
2547
2547
name : Spanned {
2548
2548
node : name,
2549
- span : span ,
2549
+ span,
2550
2550
} ,
2551
- span : span ,
2552
- expr : expr ,
2551
+ span,
2552
+ expr,
2553
2553
is_shorthand : false ,
2554
2554
}
2555
2555
}
@@ -2578,8 +2578,8 @@ impl<'a> LoweringContext<'a> {
2578
2578
} ;
2579
2579
2580
2580
let expr_path = hir:: ExprPath ( hir:: QPath :: Resolved ( None , P ( hir:: Path {
2581
- span : span ,
2582
- def : def ,
2581
+ span,
2582
+ def,
2583
2583
segments : hir_vec ! [ hir:: PathSegment :: from_name( id) ] ,
2584
2584
} ) ) ) ;
2585
2585
@@ -2619,9 +2619,9 @@ impl<'a> LoweringContext<'a> {
2619
2619
fn expr ( & mut self , span : Span , node : hir:: Expr_ , attrs : ThinVec < Attribute > ) -> hir:: Expr {
2620
2620
hir:: Expr {
2621
2621
id : self . next_id ( ) ,
2622
- node : node ,
2623
- span : span ,
2624
- attrs : attrs ,
2622
+ node,
2623
+ span,
2624
+ attrs,
2625
2625
}
2626
2626
}
2627
2627
@@ -2632,7 +2632,7 @@ impl<'a> LoweringContext<'a> {
2632
2632
source : hir:: LocalSource )
2633
2633
-> hir:: Stmt {
2634
2634
let local = P ( hir:: Local {
2635
- pat : pat ,
2635
+ pat,
2636
2636
ty : None ,
2637
2637
init : ex,
2638
2638
id : self . next_id ( ) ,
@@ -2662,11 +2662,11 @@ impl<'a> LoweringContext<'a> {
2662
2662
fn block_all ( & mut self , span : Span , stmts : hir:: HirVec < hir:: Stmt > , expr : Option < P < hir:: Expr > > )
2663
2663
-> hir:: Block {
2664
2664
hir:: Block {
2665
- stmts : stmts ,
2666
- expr : expr ,
2665
+ stmts,
2666
+ expr,
2667
2667
id : self . next_id ( ) ,
2668
2668
rules : hir:: DefaultBlock ,
2669
- span : span ,
2669
+ span,
2670
2670
targeted_by_break : false ,
2671
2671
}
2672
2672
}
@@ -2719,15 +2719,15 @@ impl<'a> LoweringContext<'a> {
2719
2719
} ;
2720
2720
2721
2721
P ( hir:: Pat {
2722
- id : id ,
2722
+ id,
2723
2723
node : hir:: PatKind :: Binding ( bm,
2724
2724
def_id,
2725
2725
Spanned {
2726
- span : span ,
2726
+ span,
2727
2727
node : name,
2728
2728
} ,
2729
2729
None ) ,
2730
- span : span ,
2730
+ span,
2731
2731
} )
2732
2732
}
2733
2733
@@ -2739,7 +2739,7 @@ impl<'a> LoweringContext<'a> {
2739
2739
P ( hir:: Pat {
2740
2740
id : self . next_id ( ) ,
2741
2741
node : pat,
2742
- span : span ,
2742
+ span,
2743
2743
} )
2744
2744
}
2745
2745
@@ -2748,7 +2748,7 @@ impl<'a> LoweringContext<'a> {
2748
2748
/// The path is also resolved according to `is_value`.
2749
2749
fn std_path ( & mut self , span : Span , components : & [ & str ] , is_value : bool ) -> hir:: Path {
2750
2750
let mut path = hir:: Path {
2751
- span : span ,
2751
+ span,
2752
2752
def : Def :: Err ,
2753
2753
segments : iter:: once ( keywords:: CrateRoot . name ( ) ) . chain ( {
2754
2754
self . crate_root . into_iter ( ) . chain ( components. iter ( ) . cloned ( ) ) . map ( Symbol :: intern)
@@ -2769,9 +2769,9 @@ impl<'a> LoweringContext<'a> {
2769
2769
let id = self . next_id ( ) ;
2770
2770
let block = P ( hir:: Block {
2771
2771
rules : rule,
2772
- span : span ,
2773
- id : id ,
2774
- stmts : stmts ,
2772
+ span,
2773
+ id,
2774
+ stmts,
2775
2775
expr : Some ( expr) ,
2776
2776
targeted_by_break : false ,
2777
2777
} ) ;
@@ -2810,7 +2810,7 @@ impl<'a> LoweringContext<'a> {
2810
2810
fn elided_lifetime ( & mut self , span : Span ) -> hir:: Lifetime {
2811
2811
hir:: Lifetime {
2812
2812
id : self . next_id ( ) ,
2813
- span : span ,
2813
+ span,
2814
2814
name : keywords:: Invalid . name ( )
2815
2815
}
2816
2816
}
0 commit comments