Skip to content
/ rust Public
forked from rust-lang/rust

Commit c2c6cb4

Browse files
committed
Fix too-short variance slice in variances_of cycle recovery
1 parent 32ea361 commit c2c6cb4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

compiler/rustc_query_impl/src/handle_cycle_error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub(crate) fn variances_of<'tcx>(
104104
err: Diag<'_>,
105105
) -> &'tcx [ty::Variance] {
106106
let _guar = err.delay_as_bug();
107-
let n = tcx.generics_of(def_id).own_params.len();
107+
let n = tcx.generics_of(def_id).count();
108108
tcx.arena.alloc_from_iter(iter::repeat_n(ty::Bivariant, n))
109109
}
110110

0 commit comments

Comments
 (0)