1
Fork 0

Use derive_default_enum in the compiler

This commit is contained in:
Jacob Pratt 2021-11-22 20:17:53 -05:00
parent 936f2600b6
commit 7b103e7dd2
No known key found for this signature in database
GPG key ID: B80E19E4662B5AA4
9 changed files with 17 additions and 31 deletions

View file

@ -30,6 +30,7 @@
#![feature(bool_to_option)]
#![feature(box_patterns)]
#![feature(core_intrinsics)]
#![feature(derive_default_enum)]
#![feature(discriminant_kind)]
#![feature(exhaustive_patterns)]
#![feature(if_let_guard)]

View file

@ -2263,10 +2263,11 @@ impl<'tcx> TyS<'tcx> {
/// a miscompilation or unsoundness.
///
/// When in doubt, use `VarianceDiagInfo::default()`
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
pub enum VarianceDiagInfo<'tcx> {
/// No additional information - this is the default.
/// We will not add any additional information to error messages.
#[default]
None,
/// We switched our variance because a type occurs inside
/// the generic argument of a mutable reference or pointer
@ -2301,9 +2302,3 @@ impl<'tcx> VarianceDiagInfo<'tcx> {
}
}
}
impl<'tcx> Default for VarianceDiagInfo<'tcx> {
fn default() -> Self {
Self::None
}
}