mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Cleanup of lints
This commit is contained in:
parent
6e0e11ea79
commit
1960f429bd
6 changed files with 13 additions and 16 deletions
|
@ -454,7 +454,7 @@ impl<
|
|||
self.interns
|
||||
}
|
||||
fn interner(&self) -> &STLayoutInterner<'a> {
|
||||
&self.layout_interner
|
||||
self.layout_interner
|
||||
}
|
||||
fn module_interns_helpers_mut(
|
||||
&mut self,
|
||||
|
|
|
@ -111,10 +111,10 @@ impl From<&StoredValue> for CodeGenNumType {
|
|||
}
|
||||
|
||||
fn layout_is_signed_int(layout: InLayout) -> bool {
|
||||
match layout {
|
||||
Layout::I8 | Layout::I16 | Layout::I32 | Layout::I64 | Layout::I128 => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(
|
||||
layout,
|
||||
Layout::I8 | Layout::I16 | Layout::I32 | Layout::I64 | Layout::I128
|
||||
)
|
||||
}
|
||||
|
||||
fn symbol_is_signed_int(backend: &WasmBackend<'_, '_>, symbol: Symbol) -> bool {
|
||||
|
@ -2386,7 +2386,7 @@ pub fn call_higher_order_lowlevel<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
fn unwrap_list_elem_layout<'a>(list_layout: Layout<'a>) -> InLayout<'a> {
|
||||
fn unwrap_list_elem_layout(list_layout: Layout) -> InLayout {
|
||||
match list_layout {
|
||||
Layout::Builtin(Builtin::List(x)) => x,
|
||||
e => internal_error!("expected List layout, got {:?}", e),
|
||||
|
|
|
@ -3076,13 +3076,10 @@ fn update<'a>(
|
|||
std::mem::swap(&mut state.layout_interner, &mut taken);
|
||||
taken
|
||||
};
|
||||
let layout_interner = layout_interner
|
||||
let mut layout_interner = layout_interner
|
||||
.unwrap()
|
||||
.expect("outstanding references to global layout interener, but we just drained all layout caches");
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
let mut layout_interner = layout_interner;
|
||||
|
||||
log!("specializations complete from {:?}", module_id);
|
||||
|
||||
debug_print_ir!(state, &layout_interner, ROC_PRINT_IR_AFTER_SPECIALIZATION);
|
||||
|
|
|
@ -1402,7 +1402,7 @@ fn path_to_expr_help<'a>(
|
|||
tag_id: *tag_id,
|
||||
structure: symbol,
|
||||
index,
|
||||
union_layout: union_layout,
|
||||
union_layout,
|
||||
};
|
||||
|
||||
let inner_layout = union_layout.layout_at(
|
||||
|
|
|
@ -2338,17 +2338,17 @@ impl<'a> Layout<'a> {
|
|||
}
|
||||
|
||||
match symbol {
|
||||
Symbol::NUM_DECIMAL => return cacheable(Ok(Layout::DEC)),
|
||||
Symbol::NUM_DECIMAL => cacheable(Ok(Layout::DEC)),
|
||||
|
||||
Symbol::NUM_NAT | Symbol::NUM_NATURAL => {
|
||||
return cacheable(Ok(Layout::usize(env.target_info)))
|
||||
cacheable(Ok(Layout::usize(env.target_info)))
|
||||
}
|
||||
|
||||
Symbol::NUM_NUM | Symbol::NUM_INT | Symbol::NUM_INTEGER
|
||||
if is_unresolved_var(env.subs, actual_var) =>
|
||||
{
|
||||
// default to i64
|
||||
return cacheable(Ok(Layout::default_integer()));
|
||||
cacheable(Ok(Layout::default_integer()))
|
||||
}
|
||||
|
||||
Symbol::NUM_FRAC | Symbol::NUM_FLOATINGPOINT
|
||||
|
@ -2356,7 +2356,7 @@ impl<'a> Layout<'a> {
|
|||
|| is_any_float_range(env.subs, actual_var) =>
|
||||
{
|
||||
// default to f64
|
||||
return cacheable(Ok(Layout::default_float()));
|
||||
cacheable(Ok(Layout::default_float()))
|
||||
}
|
||||
|
||||
_ => Self::from_var(env, actual_var),
|
||||
|
|
|
@ -1424,7 +1424,7 @@ fn add_tag_union<'a>(
|
|||
}
|
||||
Layout::Struct { field_layouts, .. } => {
|
||||
let (tag_name, payload_fields) =
|
||||
single_tag_payload_fields(union_tags, subs, &field_layouts, env, types);
|
||||
single_tag_payload_fields(union_tags, subs, field_layouts, env, types);
|
||||
|
||||
// A recursive tag union with just one constructor
|
||||
// Optimization: No need to store a tag ID (the payload is "unwrapped")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue