diagnostics: avoid mismatch between variance index and hir generic
This happens because variances are constructed from ty generics, and ty generics are always constructed with lifetimes first.
b3aa8e7168/compiler/rustc_hir_analysis/src/collect/generics_of.rs (L248-L269)
Fixes #83556
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.