make clippy happier

This commit is contained in:
Brendan Hansknecht 2022-02-17 17:55:29 -08:00
parent 066cc9e3ef
commit bf6e825e25
2 changed files with 4 additions and 5 deletions

View file

@ -1028,8 +1028,7 @@ impl<
} }
fn create_struct(&mut self, sym: &Symbol, layout: &Layout<'a>, fields: &'a [Symbol]) { fn create_struct(&mut self, sym: &Symbol, layout: &Layout<'a>, fields: &'a [Symbol]) {
return self self.storage_manager
.storage_manager
.create_struct(&mut self.buf, sym, layout, fields); .create_struct(&mut self.buf, sym, layout, fields);
} }

View file

@ -375,8 +375,8 @@ impl<
Stack(Complex { base_offset, size }) => { Stack(Complex { base_offset, size }) => {
let (base_offset, size) = (*base_offset, *size); let (base_offset, size) = (*base_offset, *size);
let mut data_offset = base_offset; let mut data_offset = base_offset;
for i in 0..index as usize { for layout in field_layouts.iter().take(index as usize) {
let field_size = field_layouts[i].stack_size(self.target_info); let field_size = layout.stack_size(self.target_info);
data_offset += field_size as i32; data_offset += field_size as i32;
} }
debug_assert!(data_offset < base_offset + size as i32); debug_assert!(data_offset < base_offset + size as i32);
@ -705,6 +705,6 @@ impl<
} }
} }
fn is_primitive<'a>(layout: &Layout<'a>) -> bool { fn is_primitive(layout: &Layout<'_>) -> bool {
matches!(layout, single_register_layouts!()) matches!(layout, single_register_layouts!())
} }