@@ -47,9 +47,9 @@ pub struct Snapshot {
47
47
snapshot : sv:: Snapshot
48
48
}
49
49
50
- enum UndoEntry {
50
+ enum UndoEntry < ' tcx > {
51
51
// The type of the var was specified.
52
- SpecifyVar ( ty:: TyVid , Vec < Relation > ) ,
52
+ SpecifyVar ( ty:: TyVid , Vec < Relation > , Option < Default < ' tcx > > ) ,
53
53
Relate ( ty:: TyVid , ty:: TyVid ) ,
54
54
}
55
55
@@ -118,8 +118,8 @@ impl<'tcx> TypeVariableTable<'tcx> {
118
118
mem:: replace ( value_ptr, Known ( ty) )
119
119
} ;
120
120
121
- let relations = match old_value {
122
- Bounded { relations, .. } => relations,
121
+ let ( relations, default ) = match old_value {
122
+ Bounded { relations, default } => ( relations, default ) ,
123
123
Known ( _) => panic ! ( "Asked to instantiate variable that is \
124
124
already instantiated")
125
125
} ;
@@ -128,7 +128,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
128
128
stack. push ( ( ty, dir, vid) ) ;
129
129
}
130
130
131
- self . values . record ( SpecifyVar ( vid, relations) ) ;
131
+ self . values . record ( SpecifyVar ( vid, relations, default ) ) ;
132
132
}
133
133
134
134
pub fn new_var ( & mut self ,
@@ -198,7 +198,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
198
198
debug ! ( "NewElem({}) new_elem_threshold={}" , index, new_elem_threshold) ;
199
199
}
200
200
201
- sv:: UndoLog :: Other ( SpecifyVar ( vid, _) ) => {
201
+ sv:: UndoLog :: Other ( SpecifyVar ( vid, _, _ ) ) => {
202
202
if vid. index < new_elem_threshold {
203
203
// quick check to see if this variable was
204
204
// created since the snapshot started or not.
@@ -229,12 +229,15 @@ impl<'tcx> TypeVariableTable<'tcx> {
229
229
230
230
impl < ' tcx > sv:: SnapshotVecDelegate for Delegate < ' tcx > {
231
231
type Value = TypeVariableData < ' tcx > ;
232
- type Undo = UndoEntry ;
232
+ type Undo = UndoEntry < ' tcx > ;
233
233
234
- fn reverse ( values : & mut Vec < TypeVariableData < ' tcx > > , action : UndoEntry ) {
234
+ fn reverse ( values : & mut Vec < TypeVariableData < ' tcx > > , action : UndoEntry < ' tcx > ) {
235
235
match action {
236
- SpecifyVar ( vid, relations) => {
237
- values[ vid. index as usize ] . value = Bounded { relations : relations, default : None } ;
236
+ SpecifyVar ( vid, relations, default) => {
237
+ values[ vid. index as usize ] . value = Bounded {
238
+ relations : relations,
239
+ default : default
240
+ } ;
238
241
}
239
242
240
243
Relate ( a, b) => {
0 commit comments