@@ -2419,43 +2419,6 @@ impl<'tcx> rustc_type_ir::inherent::Tys<TyCtxt<'tcx>> for &'tcx ty::List<Ty<'tcx
2419
2419
}
2420
2420
}
2421
2421
2422
- /// Extra information about why we ended up with a particular variance.
2423
- /// This is only used to add more information to error messages, and
2424
- /// has no effect on soundness. While choosing the 'wrong' `VarianceDiagInfo`
2425
- /// may lead to confusing notes in error messages, it will never cause
2426
- /// a miscompilation or unsoundness.
2427
- ///
2428
- /// When in doubt, use `VarianceDiagInfo::default()`
2429
- #[ derive( Copy , Clone , Debug , Default , PartialEq , Eq ) ]
2430
- pub enum VarianceDiagInfo < ' tcx > {
2431
- /// No additional information - this is the default.
2432
- /// We will not add any additional information to error messages.
2433
- #[ default]
2434
- None ,
2435
- /// We switched our variance because a generic argument occurs inside
2436
- /// the invariant generic argument of another type.
2437
- Invariant {
2438
- /// The generic type containing the generic parameter
2439
- /// that changes the variance (e.g. `*mut T`, `MyStruct<T>`)
2440
- ty : Ty < ' tcx > ,
2441
- /// The index of the generic parameter being used
2442
- /// (e.g. `0` for `*mut T`, `1` for `MyStruct<'CovariantParam, 'InvariantParam>`)
2443
- param_index : u32 ,
2444
- } ,
2445
- }
2446
-
2447
- impl < ' tcx > VarianceDiagInfo < ' tcx > {
2448
- /// Mirrors `Variance::xform` - used to 'combine' the existing
2449
- /// and new `VarianceDiagInfo`s when our variance changes.
2450
- pub fn xform ( self , other : VarianceDiagInfo < ' tcx > ) -> VarianceDiagInfo < ' tcx > {
2451
- // For now, just use the first `VarianceDiagInfo::Invariant` that we see
2452
- match self {
2453
- VarianceDiagInfo :: None => other,
2454
- VarianceDiagInfo :: Invariant { .. } => self ,
2455
- }
2456
- }
2457
- }
2458
-
2459
2422
// Some types are used a lot. Make sure they don't unintentionally get bigger.
2460
2423
#[ cfg( target_pointer_width = "64" ) ]
2461
2424
mod size_asserts {
0 commit comments