about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2021-11-22 20:17:53 -0500
committerJacob Pratt <jacob@jhpratt.dev>2021-11-22 20:17:53 -0500
commit7b103e7dd2df75e4e8dbb333bc79ffc7e9304f65 (patch)
treef6a0f083c46b82bea3ba0395c1c108c2b7c30d62 /compiler/rustc_trait_selection/src/traits
parent936f2600b6c903b04387f74ed5cbce88bb06d243 (diff)
downloadrust-7b103e7dd2df75e4e8dbb333bc79ffc7e9304f65.tar.gz
rust-7b103e7dd2df75e4e8dbb333bc79ffc7e9304f65.zip
Use `derive_default_enum` in the compiler
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
-rw-r--r--compiler/rustc_trait_selection/src/traits/mod.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs
index 91671994c5a..4bc22d5d735 100644
--- a/compiler/rustc_trait_selection/src/traits/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/mod.rs
@@ -82,9 +82,14 @@ pub use self::chalk_fulfill::FulfillmentContext as ChalkFulfillmentContext;
 pub use rustc_infer::traits::*;
 
 /// Whether to skip the leak check, as part of a future compatibility warning step.
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
+///
+/// The "default" for skip-leak-check corresponds to the current
+/// behavior (do not skip the leak check) -- not the behavior we are
+/// transitioning into.
+#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
 pub enum SkipLeakCheck {
     Yes,
+    #[default]
     No,
 }
 
@@ -94,15 +99,6 @@ impl SkipLeakCheck {
     }
 }
 
-/// The "default" for skip-leak-check corresponds to the current
-/// behavior (do not skip the leak check) -- not the behavior we are
-/// transitioning into.
-impl Default for SkipLeakCheck {
-    fn default() -> Self {
-        SkipLeakCheck::No
-    }
-}
-
 /// The mode that trait queries run in.
 #[derive(Copy, Clone, PartialEq, Eq, Debug)]
 pub enum TraitQueryMode {