Expect the test to panic by catching the unwind

This commit is contained in:
Dominik Gschwind 2022-08-21 22:48:53 +02:00
parent ad7a1ed8cc
commit ac8cb8ce3b
No known key found for this signature in database
GPG key ID: FD3C82A9C51C4025
2 changed files with 15 additions and 5 deletions

View file

@ -183,9 +183,12 @@ pub(crate) fn generics(db: &dyn DefDatabase, def: GenericDefId) -> Generics {
parent_params.iter().any(|(_, x)| matches!(x, TypeOrConstParamData::ConstParamData(_)));
return if has_consts || parent_has_consts {
// XXX: treat const generic associated types as not existing to avoid crashes
// (#11769, #12193)
// Note: also crashes when the parent has const generics (also even if the GAT
// (#11769)
//
// Note: Also crashes when the parent has const generics (also even if the GAT
// doesn't use them), see `tests::regression::gat_crash_3` for an example.
// Avoids that by disabling GATs when the parent (i.e. `impl` block) has
// const generics (#12193).
//
// Chalk expects the inner associated type's parameters to come
// *before*, not after the trait's generics as we've always done it.