@@ -1788,14 +1788,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1788
1788
)
1789
1789
}
1790
1790
1791
- fn lower_local ( & mut self , l : & Local ) -> ( hir:: Local < ' hir > , SmallVec < [ NodeId ; 1 ] > ) {
1792
- let mut ids = SmallVec :: < [ NodeId ; 1 ] > :: new ( ) ;
1793
- if self . sess . features_untracked ( ) . impl_trait_in_bindings {
1794
- if let Some ( ref ty) = l. ty {
1795
- let mut visitor = ImplTraitTypeIdVisitor { ids : & mut ids } ;
1796
- visitor. visit_ty ( ty) ;
1797
- }
1798
- }
1791
+ fn lower_local ( & mut self , l : & Local ) -> hir:: Local < ' hir > {
1799
1792
let ty = l. ty . as_ref ( ) . map ( |t| {
1800
1793
let mut capturable_lifetimes;
1801
1794
self . lower_ty (
@@ -1814,17 +1807,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
1814
1807
let init = l. init . as_ref ( ) . map ( |e| self . lower_expr ( e) ) ;
1815
1808
let hir_id = self . lower_node_id ( l. id ) ;
1816
1809
self . lower_attrs ( hir_id, & l. attrs ) ;
1817
- (
1818
- hir:: Local {
1819
- hir_id,
1820
- ty,
1821
- pat : self . lower_pat ( & l. pat ) ,
1822
- init,
1823
- span : l. span ,
1824
- source : hir:: LocalSource :: Normal ,
1825
- } ,
1826
- ids,
1827
- )
1810
+ hir:: Local {
1811
+ hir_id,
1812
+ ty,
1813
+ pat : self . lower_pat ( & l. pat ) ,
1814
+ init,
1815
+ span : l. span ,
1816
+ source : hir:: LocalSource :: Normal ,
1817
+ }
1828
1818
}
1829
1819
1830
1820
fn lower_fn_params_to_names ( & mut self , decl : & FnDecl ) -> & ' hir [ Ident ] {
@@ -2438,27 +2428,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2438
2428
fn lower_stmt ( & mut self , s : & Stmt ) -> SmallVec < [ hir:: Stmt < ' hir > ; 1 ] > {
2439
2429
let ( hir_id, kind) = match s. kind {
2440
2430
StmtKind :: Local ( ref l) => {
2441
- let ( l, item_ids) = self . lower_local ( l) ;
2442
- let mut ids: SmallVec < [ hir:: Stmt < ' hir > ; 1 ] > = item_ids
2443
- . into_iter ( )
2444
- . map ( |item_id| {
2445
- let item_id = hir:: ItemId {
2446
- // All the items that `lower_local` finds are `impl Trait` types.
2447
- def_id : self . lower_node_id ( item_id) . expect_owner ( ) ,
2448
- } ;
2449
- self . stmt ( s. span , hir:: StmtKind :: Item ( item_id) )
2450
- } )
2451
- . collect ( ) ;
2431
+ let l = self . lower_local ( l) ;
2452
2432
let hir_id = self . lower_node_id ( s. id ) ;
2453
2433
self . alias_attrs ( hir_id, l. hir_id ) ;
2454
- ids. push ( {
2455
- hir:: Stmt {
2456
- hir_id,
2457
- kind : hir:: StmtKind :: Local ( self . arena . alloc ( l) ) ,
2458
- span : s. span ,
2459
- }
2460
- } ) ;
2461
- return ids;
2434
+ return smallvec ! [ hir:: Stmt {
2435
+ hir_id,
2436
+ kind: hir:: StmtKind :: Local ( self . arena. alloc( l) ) ,
2437
+ span: s. span,
2438
+ } ] ;
2462
2439
}
2463
2440
StmtKind :: Item ( ref it) => {
2464
2441
// Can only use the ID once.
0 commit comments