From c2c6cb43e85a0c98585b74dcbf142ec42a7e38ef Mon Sep 17 00:00:00 2001 From: xmakro Date: Fri, 19 Jun 2026 19:27:51 -0700 Subject: [PATCH] Fix too-short variance slice in `variances_of` cycle recovery --- compiler/rustc_query_impl/src/handle_cycle_error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_query_impl/src/handle_cycle_error.rs b/compiler/rustc_query_impl/src/handle_cycle_error.rs index 79e7788cafe81..2beef6d6e3367 100644 --- a/compiler/rustc_query_impl/src/handle_cycle_error.rs +++ b/compiler/rustc_query_impl/src/handle_cycle_error.rs @@ -104,7 +104,7 @@ pub(crate) fn variances_of<'tcx>( err: Diag<'_>, ) -> &'tcx [ty::Variance] { let _guar = err.delay_as_bug(); - let n = tcx.generics_of(def_id).own_params.len(); + let n = tcx.generics_of(def_id).count(); tcx.arena.alloc_from_iter(iter::repeat_n(ty::Bivariant, n)) }