@@ -1790,43 +1790,6 @@ impl<'tcx> rustc_type_ir::inherent::Tys<TyCtxt<'tcx>> for &'tcx ty::List<Ty<'tcx
1790
1790
}
1791
1791
}
1792
1792
1793
- /// Extra information about why we ended up with a particular variance.
1794
- /// This is only used to add more information to error messages, and
1795
- /// has no effect on soundness. While choosing the 'wrong' `VarianceDiagInfo`
1796
- /// may lead to confusing notes in error messages, it will never cause
1797
- /// a miscompilation or unsoundness.
1798
- ///
1799
- /// When in doubt, use `VarianceDiagInfo::default()`
1800
- #[ derive( Copy , Clone , Debug , Default , PartialEq , Eq ) ]
1801
- pub enum VarianceDiagInfo < ' tcx > {
1802
- /// No additional information - this is the default.
1803
- /// We will not add any additional information to error messages.
1804
- #[ default]
1805
- None ,
1806
- /// We switched our variance because a generic argument occurs inside
1807
- /// the invariant generic argument of another type.
1808
- Invariant {
1809
- /// The generic type containing the generic parameter
1810
- /// that changes the variance (e.g. `*mut T`, `MyStruct<T>`)
1811
- ty : Ty < ' tcx > ,
1812
- /// The index of the generic parameter being used
1813
- /// (e.g. `0` for `*mut T`, `1` for `MyStruct<'CovariantParam, 'InvariantParam>`)
1814
- param_index : u32 ,
1815
- } ,
1816
- }
1817
-
1818
- impl < ' tcx > VarianceDiagInfo < ' tcx > {
1819
- /// Mirrors `Variance::xform` - used to 'combine' the existing
1820
- /// and new `VarianceDiagInfo`s when our variance changes.
1821
- pub fn xform ( self , other : VarianceDiagInfo < ' tcx > ) -> VarianceDiagInfo < ' tcx > {
1822
- // For now, just use the first `VarianceDiagInfo::Invariant` that we see
1823
- match self {
1824
- VarianceDiagInfo :: None => other,
1825
- VarianceDiagInfo :: Invariant { .. } => self ,
1826
- }
1827
- }
1828
- }
1829
-
1830
1793
// Some types are used a lot. Make sure they don't unintentionally get bigger.
1831
1794
#[ cfg( target_pointer_width = "64" ) ]
1832
1795
mod size_asserts {
0 commit comments