Skip to content

Commit

Permalink
Use Default more in InferCtxtInner.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Oct 8, 2024
1 parent 4df21f2 commit 1dac23f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
12 changes: 6 additions & 6 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ impl<'tcx> InferCtxtInner<'tcx> {
undo_log: InferCtxtUndoLogs::default(),

projection_cache: Default::default(),
type_variable_storage: type_variable::TypeVariableStorage::new(),
const_unification_storage: ut::UnificationTableStorage::new(),
int_unification_storage: ut::UnificationTableStorage::new(),
float_unification_storage: ut::UnificationTableStorage::new(),
effect_unification_storage: ut::UnificationTableStorage::new(),
region_constraint_storage: Some(RegionConstraintStorage::new()),
type_variable_storage: Default::default(),
const_unification_storage: Default::default(),
int_unification_storage: Default::default(),
float_unification_storage: Default::default(),
effect_unification_storage: Default::default(),
region_constraint_storage: Some(Default::default()),
region_obligations: vec![],
opaque_type_storage: Default::default(),
}
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_infer/src/infer/region_constraints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,6 @@ pub(crate) struct RegionSnapshot {
}

impl<'tcx> RegionConstraintStorage<'tcx> {
pub fn new() -> Self {
Self::default()
}

#[inline]
pub(crate) fn with_log<'a>(
&'a mut self,
Expand Down
9 changes: 1 addition & 8 deletions compiler/rustc_infer/src/infer/type_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl<'tcx> Rollback<sv::UndoLog<ut::Delegate<TyVidEqKey<'tcx>>>> for TypeVariabl
}
}

#[derive(Clone)]
#[derive(Clone, Default)]
pub(crate) struct TypeVariableStorage<'tcx> {
/// The origins of each type variable.
values: IndexVec<TyVid, TypeVariableData>,
Expand Down Expand Up @@ -74,13 +74,6 @@ impl<'tcx> TypeVariableValue<'tcx> {
}

impl<'tcx> TypeVariableStorage<'tcx> {
pub(crate) fn new() -> TypeVariableStorage<'tcx> {
TypeVariableStorage {
values: Default::default(),
eq_relations: ut::UnificationTableStorage::new(),
}
}

#[inline]
pub(crate) fn with_log<'a>(
&'a mut self,
Expand Down

0 comments on commit 1dac23f

Please sign in to comment.