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

@ -95,9 +95,10 @@ pub(crate) type UnificationTable<'a, 'tcx, T> = ut::UnificationTable<
/// This is used so that the region values inferred by HIR region solving are
/// not exposed, and so that we can avoid doing work in HIR typeck that MIR
/// typeck will also do.
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Default)]
pub enum RegionckMode {
/// The default mode: report region errors, don't erase regions.
#[default]
Solve,
/// Erase the results of region after solving.
Erase {
@ -108,12 +109,6 @@ pub enum RegionckMode {
},
}
impl Default for RegionckMode {
fn default() -> Self {
RegionckMode::Solve
}
}
impl RegionckMode {
/// Indicates that the MIR borrowck will repeat these region
/// checks, so we should ignore errors if NLL is (unconditionally)