File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ bitflags::bitflags! {
132
132
#[ derive( Default ) ]
133
133
pub ( crate ) struct TypeVariableFlags : u8 {
134
134
const DIVERGING = 1 << 0 ;
135
+ const INTEGER = 1 << 1 ;
136
+ const FLOAT = 1 << 2 ;
135
137
}
136
138
}
137
139
@@ -258,8 +260,14 @@ impl<'a> InferenceTable<'a> {
258
260
// Chalk might have created some type variables for its own purposes that we don't know about...
259
261
self . extend_type_variable_table ( var. index ( ) as usize ) ;
260
262
assert_eq ! ( var. index( ) as usize , self . type_variable_table. len( ) - 1 ) ;
263
+ let flags = self . type_variable_table . get_mut ( var. index ( ) as usize ) . unwrap ( ) ;
261
264
if diverging {
262
- self . type_variable_table [ var. index ( ) as usize ] |= TypeVariableFlags :: DIVERGING ;
265
+ * flags |= TypeVariableFlags :: DIVERGING ;
266
+ }
267
+ if matches ! ( kind, TyVariableKind :: Integer ) {
268
+ * flags |= TypeVariableFlags :: INTEGER ;
269
+ } else if matches ! ( kind, TyVariableKind :: Float ) {
270
+ * flags |= TypeVariableFlags :: FLOAT ;
263
271
}
264
272
var. to_ty_with_kind ( Interner , kind)
265
273
}
You can’t perform that action at this time.
0 commit comments