1
Fork 0

Rollup merge of #131049 - compiler-errors:more-validation, r=spastorino

Validate args are correct for `UnevaluatedConst`, `ExistentialTraitRef`/`ExistentialProjection`

For the `Existential*` ones, we have to do some adjustment to the args list to deal with the missing `Self` type, so we introduce a `debug_assert_existential_args_compatible` function to the interner as well.
This commit is contained in:
Matthias Krüger 2024-10-22 15:28:38 +02:00 committed by GitHub
commit 3f15d296f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 104 additions and 32 deletions

View file

@ -322,7 +322,7 @@ impl<'tcx> ReachableContext<'tcx> {
self.visit(ty);
// Manually visit to actually see the trait's `DefId`. Type visitors won't see it
if let Some(trait_ref) = dyn_ty.principal() {
let ExistentialTraitRef { def_id, args } = trait_ref.skip_binder();
let ExistentialTraitRef { def_id, args, .. } = trait_ref.skip_binder();
self.visit_def_id(def_id, "", &"");
self.visit(args);
}