From b4b557c9ef6e9537674c4031f53762277bd0fcbc Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Wed, 14 May 2025 16:12:27 -0400 Subject: [PATCH] nak: s/HashSet::new()/Default::default()/ wherever this doesn't result in type inference failing. Part-of: --- src/nouveau/compiler/nak/assign_regs.rs | 2 +- src/nouveau/compiler/nak/calc_instr_deps.rs | 2 +- src/nouveau/compiler/nak/from_nir.rs | 4 ++-- src/nouveau/compiler/nak/liveness.rs | 2 +- src/nouveau/compiler/nak/opt_dce.rs | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nouveau/compiler/nak/assign_regs.rs b/src/nouveau/compiler/nak/assign_regs.rs index 18fcf45dd66..eb6877ee7c4 100644 --- a/src/nouveau/compiler/nak/assign_regs.rs +++ b/src/nouveau/compiler/nak/assign_regs.rs @@ -18,7 +18,7 @@ struct KillSet { impl KillSet { pub fn new() -> KillSet { KillSet { - set: HashSet::new(), + set: Default::default(), vec: Vec::new(), } } diff --git a/src/nouveau/compiler/nak/calc_instr_deps.rs b/src/nouveau/compiler/nak/calc_instr_deps.rs index b27e63af88f..b88938af97c 100644 --- a/src/nouveau/compiler/nak/calc_instr_deps.rs +++ b/src/nouveau/compiler/nak/calc_instr_deps.rs @@ -76,7 +76,7 @@ impl DepGraph { deps: Vec::new(), instr_deps: Default::default(), instr_waits: Default::default(), - active: HashSet::new(), + active: Default::default(), } } diff --git a/src/nouveau/compiler/nak/from_nir.rs b/src/nouveau/compiler/nak/from_nir.rs index c33f4cbd0b8..6cc633fe3ff 100644 --- a/src/nouveau/compiler/nak/from_nir.rs +++ b/src/nouveau/compiler/nak/from_nir.rs @@ -347,12 +347,12 @@ impl<'a> ShaderFromNir<'a> { label_alloc: LabelAllocator::new(), block_label: Default::default(), bar_label: Default::default(), - sync_blocks: HashSet::new(), + sync_blocks: Default::default(), crs: Vec::new(), fs_out_regs: [None; 34], end_block_id: 0, ssa_map: Default::default(), - saturated: HashSet::new(), + saturated: Default::default(), nir_instr_printer: NirInstrPrinter::new().unwrap(), } } diff --git a/src/nouveau/compiler/nak/liveness.rs b/src/nouveau/compiler/nak/liveness.rs index 042502be157..f94ee8c86f5 100644 --- a/src/nouveau/compiler/nak/liveness.rs +++ b/src/nouveau/compiler/nak/liveness.rs @@ -18,7 +18,7 @@ impl LiveSet { pub fn new() -> LiveSet { LiveSet { live: Default::default(), - set: HashSet::new(), + set: Default::default(), } } diff --git a/src/nouveau/compiler/nak/opt_dce.rs b/src/nouveau/compiler/nak/opt_dce.rs index 280a8d168ef..af63bec5dbd 100644 --- a/src/nouveau/compiler/nak/opt_dce.rs +++ b/src/nouveau/compiler/nak/opt_dce.rs @@ -20,8 +20,8 @@ impl DeadCodePass { DeadCodePass { any_dead: false, new_live: false, - live_ssa: HashSet::new(), - live_phi: HashSet::new(), + live_ssa: Default::default(), + live_phi: Default::default(), } }