1
Fork 0

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
This commit is contained in:
Matthias Krüger 2021-11-23 19:28:11 +01:00 committed by GitHub
commit e52e3a4bb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 31 deletions

View file

@ -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