Skip to content

Commit

Permalink
Use default field values for config::NextSolverConfig
Browse files Browse the repository at this point in the history
Use default field values to avoid manual `Default` impl.
  • Loading branch information
estebank committed Mar 3, 2025
1 parent 2a4204b commit aae7a3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 3 additions & 8 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,18 +872,13 @@ pub enum PrintKind {
DeploymentTarget,
}

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)]
pub struct NextSolverConfig {
/// Whether the new trait solver should be enabled in coherence.
pub coherence: bool,
pub coherence: bool = true,
/// Whether the new trait solver should be enabled everywhere.
/// This is only `true` if `coherence` is also enabled.
pub globally: bool,
}
impl Default for NextSolverConfig {
fn default() -> Self {
NextSolverConfig { coherence: true, globally: false }
}
pub globally: bool = false,
}

#[derive(Clone)]
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_session/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![feature(default_field_values)]
#![feature(iter_intersperse)]
#![feature(let_chains)]
#![feature(rustc_attrs)]
Expand Down

0 comments on commit aae7a3c

Please sign in to comment.