Skip to content

Commit b491b35

Browse files
nikomatsakissgrif
authored andcommitted
use {} for Known variant just for more parity
1 parent 2dba316 commit b491b35

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/librustc/infer/type_variable.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ struct TypeVariableData<'tcx> {
7979
}
8080

8181
enum TypeVariableValue<'tcx> {
82-
Known(Ty<'tcx>),
82+
Known {
83+
value: Ty<'tcx>
84+
},
8385
Bounded {
8486
default: Option<Default<'tcx>>
8587
}
@@ -120,7 +122,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
120122

121123
pub fn default(&self, vid: ty::TyVid) -> Option<Default<'tcx>> {
122124
match &self.values.get(vid.index as usize).value {
123-
&Known(_) => None,
125+
&Known { .. } => None,
124126
&Bounded { ref default, .. } => default.clone()
125127
}
126128
}
@@ -161,14 +163,14 @@ impl<'tcx> TypeVariableTable<'tcx> {
161163

162164
let old_value = {
163165
let vid_data = &mut self.values[vid.index as usize];
164-
mem::replace(&mut vid_data.value, TypeVariableValue::Known(ty))
166+
mem::replace(&mut vid_data.value, TypeVariableValue::Known { value: ty })
165167
};
166168

167169
match old_value {
168170
TypeVariableValue::Bounded { default } => {
169171
self.values.record(Instantiate { vid: vid, default: default });
170172
}
171-
TypeVariableValue::Known(old_ty) => {
173+
TypeVariableValue::Known { value: old_ty } => {
172174
bug!("instantiating type variable `{:?}` twice: new-value = {:?}, old-value={:?}",
173175
vid, ty, old_ty)
174176
}
@@ -236,7 +238,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
236238
debug_assert!(self.root_var(vid) == vid);
237239
match self.values.get(vid.index as usize).value {
238240
Bounded { .. } => None,
239-
Known(t) => Some(t)
241+
Known { value } => Some(value)
240242
}
241243
}
242244

@@ -337,7 +339,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
337339
// created since the snapshot started or not.
338340
let escaping_type = match self.values.get(vid.index as usize).value {
339341
Bounded { .. } => bug!(),
340-
Known(ty) => ty,
342+
Known { value } => value,
341343
};
342344
escaping_types.push(escaping_type);
343345
}

0 commit comments

Comments
 (0)