Skip to content

Commit aae7a3c

Browse files
committed
Use default field values for config::NextSolverConfig
Use default field values to avoid manual `Default` impl.
1 parent 2a4204b commit aae7a3c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Diff for: compiler/rustc_session/src/config.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -872,18 +872,13 @@ pub enum PrintKind {
872872
DeploymentTarget,
873873
}
874874

875-
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
875+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
876876
pub struct NextSolverConfig {
877877
/// Whether the new trait solver should be enabled in coherence.
878-
pub coherence: bool,
878+
pub coherence: bool = true,
879879
/// Whether the new trait solver should be enabled everywhere.
880880
/// This is only `true` if `coherence` is also enabled.
881-
pub globally: bool,
882-
}
883-
impl Default for NextSolverConfig {
884-
fn default() -> Self {
885-
NextSolverConfig { coherence: true, globally: false }
886-
}
881+
pub globally: bool = false,
887882
}
888883

889884
#[derive(Clone)]

Diff for: compiler/rustc_session/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// tidy-alphabetical-start
22
#![allow(internal_features)]
3+
#![feature(default_field_values)]
34
#![feature(iter_intersperse)]
45
#![feature(let_chains)]
56
#![feature(rustc_attrs)]

0 commit comments

Comments
 (0)