diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2021-11-22 20:17:53 -0500 |
|---|---|---|
| committer | Jacob Pratt <jacob@jhpratt.dev> | 2021-11-22 20:17:53 -0500 |
| commit | 7b103e7dd2df75e4e8dbb333bc79ffc7e9304f65 (patch) | |
| tree | f6a0f083c46b82bea3ba0395c1c108c2b7c30d62 /compiler/rustc_infer/src | |
| parent | 936f2600b6c903b04387f74ed5cbce88bb06d243 (diff) | |
| download | rust-7b103e7dd2df75e4e8dbb333bc79ffc7e9304f65.tar.gz rust-7b103e7dd2df75e4e8dbb333bc79ffc7e9304f65.zip | |
Use `derive_default_enum` in the compiler
Diffstat (limited to 'compiler/rustc_infer/src')
| -rw-r--r-- | compiler/rustc_infer/src/infer/mod.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/lib.rs | 1 |
2 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index b874947cc69..2fd01c2d595 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -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) diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index d0f1ff649d0..e4b407e7c11 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -15,6 +15,7 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] #![feature(box_patterns)] +#![feature(derive_default_enum)] #![feature(extend_one)] #![feature(iter_zip)] #![feature(let_else)] |
