@@ -173,31 +173,6 @@ pub(super) fn associated_type_by_name_including_super_traits(
173173
174174pub ( crate ) fn generics ( db : & dyn DefDatabase , def : GenericDefId ) -> Generics {
175175 let parent_generics = parent_generic_def ( db, def) . map ( |def| Box :: new ( generics ( db, def) ) ) ;
176- if parent_generics. is_some ( ) && matches ! ( def, GenericDefId :: TypeAliasId ( _) ) {
177- let params = db. generic_params ( def) ;
178- let parent_params = & parent_generics. as_ref ( ) . unwrap ( ) . params ;
179- let has_consts =
180- params. iter ( ) . any ( |( _, x) | matches ! ( x, TypeOrConstParamData :: ConstParamData ( _) ) ) ;
181- let parent_has_consts =
182- parent_params. iter ( ) . any ( |( _, x) | matches ! ( x, TypeOrConstParamData :: ConstParamData ( _) ) ) ;
183- return if has_consts || parent_has_consts {
184- // XXX: treat const generic associated types as not existing to avoid crashes
185- // (#11769)
186- //
187- // Note: Also crashes when the parent has const generics (also even if the GAT
188- // doesn't use them), see `tests::regression::gat_crash_3` for an example.
189- // Avoids that by disabling GATs when the parent (i.e. `impl` block) has
190- // const generics (#12193).
191- //
192- // Chalk expects the inner associated type's parameters to come
193- // *before*, not after the trait's generics as we've always done it.
194- // Adapting to this requires a larger refactoring
195- cov_mark:: hit!( ignore_gats) ;
196- Generics { def, params : Interned :: new ( Default :: default ( ) ) , parent_generics }
197- } else {
198- Generics { def, params, parent_generics }
199- } ;
200- }
201176 Generics { def, params : db. generic_params ( def) , parent_generics }
202177}
203178
0 commit comments