@@ -73,12 +73,10 @@ use syntax_pos::Span;
73
73
use rustc_error_codes:: * ;
74
74
75
75
macro_rules! arena_vec {
76
- ( ) => (
77
- & [ ]
78
- ) ;
79
- ( $this: expr; $( $x: expr) ,* ) => (
80
- $this. arena. alloc_from_iter( vec![ $( $x) ,* ] )
81
- ) ;
76
+ ( $this: expr; $( $x: expr) ,* ) => ( {
77
+ let a = [ $( $x) ,* ] ;
78
+ $this. arena. alloc_from_iter( std:: array:: IntoIter :: new( a) )
79
+ } ) ;
82
80
}
83
81
84
82
mod expr;
@@ -2018,7 +2016,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2018
2016
FunctionRetTy :: Ty ( ty) => this. lower_ty ( & ty, ImplTraitContext :: disallowed ( ) ) ,
2019
2017
FunctionRetTy :: Default ( _) => this. arena . alloc ( this. ty_tup ( span, & [ ] ) ) ,
2020
2018
} ;
2021
- let args = vec ! [ GenericArg :: Type ( this. ty_tup( span, inputs) ) ] ;
2019
+ let args = smallvec ! [ GenericArg :: Type ( this. ty_tup( span, inputs) ) ] ;
2022
2020
let binding = hir:: TypeBinding {
2023
2021
hir_id : this. next_id ( ) ,
2024
2022
ident : Ident :: with_dummy_span ( FN_OUTPUT_NAME ) ,
@@ -3300,7 +3298,7 @@ fn body_ids(bodies: &BTreeMap<hir::BodyId, hir::Body<'hir>>) -> Vec<hir::BodyId>
3300
3298
3301
3299
/// Helper struct for delayed construction of GenericArgs.
3302
3300
struct GenericArgsCtor < ' hir > {
3303
- args : Vec < hir:: GenericArg < ' hir > > ,
3301
+ args : SmallVec < [ hir:: GenericArg < ' hir > ; 1 ] > ,
3304
3302
bindings : & ' hir [ hir:: TypeBinding < ' hir > ] ,
3305
3303
parenthesized : bool ,
3306
3304
}
0 commit comments