@@ -73,12 +73,10 @@ use syntax_pos::Span;
7373use rustc_error_codes:: * ;
7474
7575macro_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+ } ) ;
8280}
8381
8482mod expr;
@@ -2018,7 +2016,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20182016 FunctionRetTy :: Ty ( ty) => this. lower_ty ( & ty, ImplTraitContext :: disallowed ( ) ) ,
20192017 FunctionRetTy :: Default ( _) => this. arena . alloc ( this. ty_tup ( span, & [ ] ) ) ,
20202018 } ;
2021- let args = vec ! [ GenericArg :: Type ( this. ty_tup( span, inputs) ) ] ;
2019+ let args = smallvec ! [ GenericArg :: Type ( this. ty_tup( span, inputs) ) ] ;
20222020 let binding = hir:: TypeBinding {
20232021 hir_id : this. next_id ( ) ,
20242022 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>
33003298
33013299/// Helper struct for delayed construction of GenericArgs.
33023300struct GenericArgsCtor < ' hir > {
3303- args : Vec < hir:: GenericArg < ' hir > > ,
3301+ args : SmallVec < [ hir:: GenericArg < ' hir > ; 1 ] > ,
33043302 bindings : & ' hir [ hir:: TypeBinding < ' hir > ] ,
33053303 parenthesized : bool ,
33063304}
0 commit comments