@@ -12,12 +12,12 @@ use rustc::ty::{self, TyCtxt};
12
12
use rustc:: mir:: * ;
13
13
use rustc:: mir:: tcx:: RvalueInitializationState ;
14
14
use rustc_data_structures:: indexed_vec:: { IndexVec } ;
15
+ use smallvec:: { SmallVec , smallvec} ;
15
16
16
17
use std:: collections:: hash_map:: Entry ;
17
18
use std:: mem;
18
19
19
20
use super :: abs_domain:: Lift ;
20
-
21
21
use super :: { LocationMap , MoveData , MovePath , MovePathLookup , MovePathIndex , MoveOut , MoveOutIndex } ;
22
22
use super :: { MoveError , InitIndex , Init , InitLocation , LookupResult , InitKind } ;
23
23
use super :: IllegalMoveOriginKind :: * ;
@@ -64,8 +64,8 @@ impl<'a, 'gcx, 'tcx> MoveDataBuilder<'a, 'gcx, 'tcx> {
64
64
}
65
65
66
66
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 ] > > ,
69
69
parent : Option < MovePathIndex > ,
70
70
place : Place < ' tcx > )
71
71
-> MovePathIndex
@@ -83,10 +83,10 @@ impl<'a, 'gcx, 'tcx> MoveDataBuilder<'a, 'gcx, 'tcx> {
83
83
move_paths[ move_path] . next_sibling = next_sibling;
84
84
}
85
85
86
- let path_map_ent = path_map. push ( vec ! [ ] ) ;
86
+ let path_map_ent = path_map. push ( smallvec ! [ ] ) ;
87
87
assert_eq ! ( path_map_ent, move_path) ;
88
88
89
- let init_path_map_ent = init_path_map. push ( vec ! [ ] ) ;
89
+ let init_path_map_ent = init_path_map. push ( smallvec ! [ ] ) ;
90
90
assert_eq ! ( init_path_map_ent, move_path) ;
91
91
92
92
move_path
0 commit comments