about summary refs log tree commit diff
path: root/compiler/rustc_session/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-11-23 19:28:11 +0100
committerGitHub <noreply@github.com>2021-11-23 19:28:11 +0100
commite52e3a4bb3efa4c75350ba11e99ebbc93a982768 (patch)
treebd96dcd84fe25954d6b20754ad86d9c4a37753ba /compiler/rustc_session/src
parenta26c2c7495b6a6d4df49d6dabe3453057804e98e (diff)
parent7b103e7dd2df75e4e8dbb333bc79ffc7e9304f65 (diff)
downloadrust-e52e3a4bb3efa4c75350ba11e99ebbc93a982768.tar.gz
rust-e52e3a4bb3efa4c75350ba11e99ebbc93a982768.zip
Rollup merge of #91148 - jhpratt:use-default-enum, r=petrochenkov
Use `derive_default_enum` in the compiler

Let's get this feature some real-world love.

``@rustbot`` label: +C-cleanup +S-waiting-on-review
Diffstat (limited to 'compiler/rustc_session/src')
-rw-r--r--compiler/rustc_session/src/config.rs9
-rw-r--r--compiler/rustc_session/src/lib.rs1
2 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 58e5087c72f..ab3c122053c 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -335,9 +335,10 @@ impl Default for ErrorOutputType {
 }
 
 /// Parameter to control path trimming.
-#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
 pub enum TrimmedDefPaths {
     /// `try_print_trimmed_def_path` never prints a trimmed path and never calls the expensive query
+    #[default]
     Never,
     /// `try_print_trimmed_def_path` calls the expensive query, the query doesn't call `delay_good_path_bug`
     Always,
@@ -345,12 +346,6 @@ pub enum TrimmedDefPaths {
     GoodPath,
 }
 
-impl Default for TrimmedDefPaths {
-    fn default() -> Self {
-        Self::Never
-    }
-}
-
 /// Use tree-based collections to cheaply get a deterministic `Hash` implementation.
 /// *Do not* switch `BTreeMap` out for an unsorted container type! That would break
 /// dependency tracking for command-line arguments. Also only hash keys, since tracking
diff --git a/compiler/rustc_session/src/lib.rs b/compiler/rustc_session/src/lib.rs
index 6c86f86ecd9..399b616915e 100644
--- a/compiler/rustc_session/src/lib.rs
+++ b/compiler/rustc_session/src/lib.rs
@@ -1,4 +1,5 @@
 #![feature(crate_visibility_modifier)]
+#![feature(derive_default_enum)]
 #![feature(min_specialization)]
 #![feature(once_cell)]
 #![recursion_limit = "256"]