File tree 1 file changed +10
-17
lines changed
src/librustc_traits/chalk
1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -145,23 +145,16 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
145
145
. map ( |( wc, _) | wc. subst ( self . tcx , bound_vars) )
146
146
. filter_map ( |wc| LowerInto :: < Option < chalk_ir:: QuantifiedWhereClause < RustInterner < ' tcx > > > > :: lower_into ( wc, & self . interner ) )
147
147
. collect ( ) ;
148
- let fields = match adt_def. adt_kind ( ) {
149
- ty:: AdtKind :: Struct | ty:: AdtKind :: Union => {
150
- let variant = adt_def. non_enum_variant ( ) ;
151
- variant
152
- . fields
153
- . iter ( )
154
- . map ( |field| {
155
- self . tcx
156
- . type_of ( field. did )
157
- . subst ( self . tcx , bound_vars)
158
- . lower_into ( & self . interner )
159
- } )
160
- . collect ( )
161
- }
162
- // FIXME(chalk): handle enums; force_impl_for requires this
163
- ty:: AdtKind :: Enum => vec ! [ ] ,
164
- } ;
148
+
149
+ let fields = adt_def
150
+ . variants
151
+ . iter ( )
152
+ . flat_map ( |variant| variant. fields . iter ( ) )
153
+ . map ( |field| {
154
+ self . tcx . type_of ( field. did ) . subst ( self . tcx , bound_vars) . lower_into ( & self . interner )
155
+ } )
156
+ . collect ( ) ;
157
+
165
158
let struct_datum = Arc :: new ( chalk_solve:: rust_ir:: AdtDatum {
166
159
id : adt_id,
167
160
binders : chalk_ir:: Binders :: new (
You can’t perform that action at this time.
0 commit comments