Skip to content

Commit

Permalink
use_field_init_shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
sragss committed Dec 4, 2023
1 parent dc2d065 commit 4d68c8a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 26 deletions.
10 changes: 5 additions & 5 deletions jolt-core/src/jolt/trace/rv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ impl RVTraceRow {
rd_post_val: common.register_state.rd_post_val,
rs1_val: common.register_state.rs1_val,
rs2_val: common.register_state.rs2_val,
memory_bytes_before: memory_bytes_before,
memory_bytes_after: memory_bytes_after,
memory_bytes_before,
memory_bytes_after,
}
}

Expand Down Expand Up @@ -1553,7 +1553,7 @@ mod trace_validation_tests {
let rs1_val: u64 = 102;
let imm_val: u32 = 202;
let jalr = RVTraceRow {
pc: pc,
pc,
opcode: RV32IM::JALR,
rd: Some(1),
rs1: Some(1),
Expand Down Expand Up @@ -1595,7 +1595,7 @@ mod trace_validation_tests {
let rs1_val: u64 = 102;
let imm_val: u32 = 202;
let jalr = RVTraceRow {
pc: pc,
pc,
opcode: RV32IM::JALR,
rd: Some(1),
rs1: Some(1),
Expand Down Expand Up @@ -1782,7 +1782,7 @@ mod trace_validation_tests {
let imm = imm_max;
let rd_expected: u64 = (imm << 12u32) as u64 + pc;
let mut auipc = RVTraceRow {
pc: pc,
pc,
opcode: RV32IM::AUIPC,
rd: Some(12),
rs1: None,
Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ edition = "2021"
tab_spaces = 4
newline_style = "Unix"
use_try_shorthand = true
use_field_init_shorthand = true
6 changes: 3 additions & 3 deletions tracer/src/emulator/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3819,7 +3819,7 @@ impl DecodeCache {

DecodeCache {
hash_map: FnvHashMap::default(),
entries: entries,
entries,
front_index: 0,
back_index: DECODE_CACHE_ENTRY_NUM - 1,
hit_count: 0,
Expand Down Expand Up @@ -3929,8 +3929,8 @@ impl DecodeCacheEntry {
DecodeCacheEntry {
word: 0,
instruction_index: INVALID_CACHE_ENTRY,
next_index: next_index,
prev_index: prev_index,
next_index,
prev_index,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tracer/src/emulator/device/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Uart {
scr: 0,
thre_ip: false,
interrupting: false,
terminal: terminal,
terminal,
}
}

Expand Down
30 changes: 15 additions & 15 deletions tracer/src/emulator/elf_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl ElfAnalyzer {
*/

Header {
e_width: e_width,
e_width,
_e_class: e_class,
_e_endian: e_endian,
_e_elf_version: e_elf_version,
Expand All @@ -208,15 +208,15 @@ impl ElfAnalyzer {
_e_type: e_type,
_e_machine: e_machine,
_e_version: e_version,
e_entry: e_entry,
e_entry,
_e_phoff: e_phoff,
e_shoff: e_shoff,
e_shoff,
_e_flags: e_flags,
_e_ehsize: e_ehsize,
_e_phentsize: e_phentsize,
_e_phnum: e_phnum,
_e_shentsize: e_shentsize,
e_shnum: e_shnum,
e_shnum,
_e_shstrndx: e_shstrndx,
}
}
Expand Down Expand Up @@ -476,12 +476,12 @@ impl ElfAnalyzer {
*/

headers.push(SectionHeader {
sh_name: sh_name,
sh_type: sh_type,
sh_name,
sh_type,
_sh_flags: sh_flags,
sh_addr: sh_addr,
sh_offset: sh_offset,
sh_size: sh_size,
sh_addr,
sh_offset,
sh_size,
_sh_link: sh_link,
_sh_info: sh_info,
_sh_addralign: sh_addralign,
Expand Down Expand Up @@ -577,12 +577,12 @@ impl ElfAnalyzer {
*/

entries.push(SymbolEntry {
st_name: st_name,
st_info: st_info,
_st_other: _st_other,
_st_shndx: _st_shndx,
st_value: st_value,
_st_size: _st_size,
st_name,
st_info,
_st_other,
_st_shndx,
st_value,
_st_size,
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions tracer/src/emulator/mmu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ impl Mmu {

Mmu {
clock: 0,
xlen: xlen,
xlen,
ppn: 0,
addressing_mode: AddressingMode::None,
privilege_mode: PrivilegeMode::Machine,
memory: MemoryWrapper::new(tracer),
dtb: dtb,
dtb,
disk: VirtioBlockDisk::new(),
plic: Plic::new(),
clint: Clint::new(),
Expand Down

0 comments on commit 4d68c8a

Please sign in to comment.