@@ -12,12 +12,12 @@ use rustc::ty::{self, TyCtxt};
1212use rustc:: mir:: * ;
1313use rustc:: mir:: tcx:: RvalueInitializationState ;
1414use rustc_data_structures:: indexed_vec:: { IndexVec } ;
15+ use smallvec:: { SmallVec , smallvec} ;
1516
1617use std:: collections:: hash_map:: Entry ;
1718use std:: mem;
1819
1920use super :: abs_domain:: Lift ;
20-
2121use super :: { LocationMap , MoveData , MovePath , MovePathLookup , MovePathIndex , MoveOut , MoveOutIndex } ;
2222use super :: { MoveError , InitIndex , Init , InitLocation , LookupResult , InitKind } ;
2323use super :: IllegalMoveOriginKind :: * ;
@@ -64,8 +64,8 @@ impl<'a, 'gcx, 'tcx> MoveDataBuilder<'a, 'gcx, 'tcx> {
6464 }
6565
6666 fn new_move_path ( move_paths : & mut IndexVec < MovePathIndex , MovePath < ' tcx > > ,
67- path_map : & mut IndexVec < MovePathIndex , Vec < MoveOutIndex > > ,
68- init_path_map : & mut IndexVec < MovePathIndex , Vec < InitIndex > > ,
67+ path_map : & mut IndexVec < MovePathIndex , SmallVec < [ MoveOutIndex ; 4 ] > > ,
68+ init_path_map : & mut IndexVec < MovePathIndex , SmallVec < [ InitIndex ; 4 ] > > ,
6969 parent : Option < MovePathIndex > ,
7070 place : Place < ' tcx > )
7171 -> MovePathIndex
@@ -83,10 +83,10 @@ impl<'a, 'gcx, 'tcx> MoveDataBuilder<'a, 'gcx, 'tcx> {
8383 move_paths[ move_path] . next_sibling = next_sibling;
8484 }
8585
86- let path_map_ent = path_map. push ( vec ! [ ] ) ;
86+ let path_map_ent = path_map. push ( smallvec ! [ ] ) ;
8787 assert_eq ! ( path_map_ent, move_path) ;
8888
89- let init_path_map_ent = init_path_map. push ( vec ! [ ] ) ;
89+ let init_path_map_ent = init_path_map. push ( smallvec ! [ ] ) ;
9090 assert_eq ! ( init_path_map_ent, move_path) ;
9191
9292 move_path
0 commit comments