mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
clippy --fix fixes
This commit is contained in:
parent
9973d4b8d2
commit
4cd8f0a056
57 changed files with 366 additions and 374 deletions
|
@ -1959,8 +1959,8 @@ pub mod test_constrain {
|
|||
};
|
||||
use indoc::indoc;
|
||||
|
||||
fn run_solve<'a>(
|
||||
arena: &'a Bump,
|
||||
fn run_solve(
|
||||
arena: &Bump,
|
||||
mempool: &mut Pool,
|
||||
aliases: MutMap<Symbol, roc_types::types::Alias>,
|
||||
rigid_variables: MutMap<Variable, Lowercase>,
|
||||
|
|
|
@ -183,7 +183,7 @@ impl Pool {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get<'a, 'b, T>(&'a self, node_id: NodeId<T>) -> &'b T {
|
||||
pub fn get<'b, T>(&self, node_id: NodeId<T>) -> &'b T {
|
||||
unsafe {
|
||||
let node_ptr = self.get_ptr(node_id) as *const T;
|
||||
|
||||
|
|
|
@ -100,11 +100,11 @@ pub fn format(files: std::vec::Vec<PathBuf>, mode: FormatMode) -> Result<(), Str
|
|||
|
||||
let mut before_file = file.clone();
|
||||
before_file.set_extension("roc-format-failed-ast-before");
|
||||
std::fs::write(&before_file, &format!("{:#?}\n", ast_normalized)).unwrap();
|
||||
std::fs::write(&before_file, format!("{:#?}\n", ast_normalized)).unwrap();
|
||||
|
||||
let mut after_file = file.clone();
|
||||
after_file.set_extension("roc-format-failed-ast-after");
|
||||
std::fs::write(&after_file, &format!("{:#?}\n", reparsed_ast_normalized)).unwrap();
|
||||
std::fs::write(&after_file, format!("{:#?}\n", reparsed_ast_normalized)).unwrap();
|
||||
|
||||
internal_error!(
|
||||
"Formatting bug; formatting didn't reparse as the same tree\n\n\
|
||||
|
|
|
@ -1235,8 +1235,10 @@ fn run_wasm<I: Iterator<Item = S>, S: AsRef<[u8]>>(_wasm_path: &std::path::Path,
|
|||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, EnumIter, IntoStaticStr, PartialEq, Eq)]
|
||||
#[derive(Default)]
|
||||
pub enum Target {
|
||||
#[strum(serialize = "system")]
|
||||
#[default]
|
||||
System,
|
||||
#[strum(serialize = "linux32")]
|
||||
Linux32,
|
||||
|
@ -1248,11 +1250,7 @@ pub enum Target {
|
|||
Wasm32,
|
||||
}
|
||||
|
||||
impl Default for Target {
|
||||
fn default() -> Self {
|
||||
Target::System
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl Target {
|
||||
pub fn to_triple(self) -> Triple {
|
||||
|
|
|
@ -13,8 +13,8 @@ use crate::{
|
|||
slow_pool::{MarkNodeId, SlowPool},
|
||||
};
|
||||
|
||||
pub fn ast_to_mark_nodes<'a>(
|
||||
env: &mut Env<'a>,
|
||||
pub fn ast_to_mark_nodes(
|
||||
env: &mut Env<'_>,
|
||||
ast: &AST,
|
||||
mark_node_pool: &mut SlowPool,
|
||||
interns: &Interns,
|
||||
|
|
|
@ -35,8 +35,8 @@ pub fn add_node(
|
|||
mark_node_id
|
||||
}
|
||||
|
||||
pub fn def2_to_markup<'a>(
|
||||
env: &mut Env<'a>,
|
||||
pub fn def2_to_markup(
|
||||
env: &mut Env<'_>,
|
||||
def2: &Def2,
|
||||
def2_node_id: DefId,
|
||||
mark_node_pool: &mut SlowPool,
|
||||
|
|
|
@ -35,8 +35,8 @@ use roc_module::{module_err::ModuleResult, symbol::Interns};
|
|||
use super::from_def2::add_node;
|
||||
|
||||
// make Markup Nodes: generate String representation, assign Highlighting Style
|
||||
pub fn expr2_to_markup<'a>(
|
||||
env: &Env<'a>,
|
||||
pub fn expr2_to_markup(
|
||||
env: &Env<'_>,
|
||||
expr2: &Expr2,
|
||||
expr2_node_id: ExprId,
|
||||
mark_node_pool: &mut SlowPool,
|
||||
|
|
|
@ -258,7 +258,7 @@ pub fn make_nested_mn(children_ids: Vec<MarkNodeId>, newlines_at_end: usize) ->
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_string<'a>(env: &Env<'a>, pool_str: &PoolStr) -> String {
|
||||
pub fn get_string(env: &Env<'_>, pool_str: &PoolStr) -> String {
|
||||
pool_str.as_str(env.pool).to_owned()
|
||||
}
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@ use super::{
|
|||
};
|
||||
|
||||
// represents for example: `main = "Hello, World!"`
|
||||
pub fn assignment_mark_node<'a>(
|
||||
pub fn assignment_mark_node(
|
||||
identifier_id: IdentId,
|
||||
expr_mark_node_id: MarkNodeId,
|
||||
ast_node_id: ASTNodeId,
|
||||
mark_node_pool: &mut SlowPool,
|
||||
mark_id_ast_id_map: &mut MarkIdAstIdMap,
|
||||
env: &Env<'a>,
|
||||
env: &Env<'_>,
|
||||
) -> ASTResult<MarkupNode> {
|
||||
let val_name = env.ident_ids.get_name_str_res(identifier_id)?;
|
||||
|
||||
|
|
|
@ -487,9 +487,9 @@ impl<'a> Env<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn apply_refcount_operation<'a>(
|
||||
fn apply_refcount_operation(
|
||||
builder: &mut FuncDefBuilder,
|
||||
env: &mut Env<'a>,
|
||||
env: &mut Env<'_>,
|
||||
block: BlockId,
|
||||
modify_rc: &ModifyRc,
|
||||
) -> Result<()> {
|
||||
|
|
|
@ -1100,7 +1100,7 @@ fn link_linux(
|
|||
// Keep NIX_ env vars
|
||||
.envs(
|
||||
env::vars()
|
||||
.filter(|&(ref k, _)| k.starts_with("NIX_"))
|
||||
.filter(|(k, _)| k.starts_with("NIX_"))
|
||||
.collect::<HashMap<String, String>>(),
|
||||
)
|
||||
.args([
|
||||
|
|
|
@ -1134,7 +1134,7 @@ fn canonicalize_has_clause(
|
|||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn can_extension_type<'a>(
|
||||
fn can_extension_type(
|
||||
env: &mut Env,
|
||||
pol: CanPolarity,
|
||||
scope: &mut Scope,
|
||||
|
@ -1142,7 +1142,7 @@ fn can_extension_type<'a>(
|
|||
introduced_variables: &mut IntroducedVariables,
|
||||
local_aliases: &mut VecMap<Symbol, Alias>,
|
||||
references: &mut VecSet<Symbol>,
|
||||
opt_ext: &Option<&Loc<TypeAnnotation<'a>>>,
|
||||
opt_ext: &Option<&Loc<TypeAnnotation<'_>>>,
|
||||
ext_problem_kind: roc_problem::can::ExtensionTypeKind,
|
||||
) -> (Type, ExtImplicitOpenness) {
|
||||
fn valid_record_ext_type(typ: &Type) -> bool {
|
||||
|
@ -1451,10 +1451,10 @@ fn can_assigned_fields<'a>(
|
|||
|
||||
// TODO trim down these arguments!
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn can_assigned_tuple_elems<'a>(
|
||||
fn can_assigned_tuple_elems(
|
||||
env: &mut Env,
|
||||
pol: CanPolarity,
|
||||
elems: &&[Loc<TypeAnnotation<'a>>],
|
||||
elems: &&[Loc<TypeAnnotation<'_>>],
|
||||
scope: &mut Scope,
|
||||
var_store: &mut VarStore,
|
||||
introduced_variables: &mut IntroducedVariables,
|
||||
|
|
|
@ -1051,7 +1051,6 @@ fn canonicalize_value_defs<'a>(
|
|||
|
||||
for (def_index, pending_def) in pending_value_defs.iter().enumerate() {
|
||||
let mut new_bindings = BindingsFromPattern::new(pending_def.loc_pattern())
|
||||
.into_iter()
|
||||
.peekable();
|
||||
|
||||
if new_bindings.peek().is_none() {
|
||||
|
@ -1339,8 +1338,8 @@ fn canonicalize_type_defs<'a>(
|
|||
|
||||
/// Resolve all pending abilities, to add them to scope.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn resolve_abilities<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn resolve_abilities(
|
||||
env: &mut Env<'_>,
|
||||
output: &mut Output,
|
||||
var_store: &mut VarStore,
|
||||
scope: &mut Scope,
|
||||
|
@ -2813,8 +2812,8 @@ fn to_pending_value_def<'a>(
|
|||
}
|
||||
|
||||
/// Make aliases recursive
|
||||
fn correct_mutual_recursive_type_alias<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn correct_mutual_recursive_type_alias(
|
||||
env: &mut Env<'_>,
|
||||
original_aliases: VecMap<Symbol, Alias>,
|
||||
var_store: &mut VarStore,
|
||||
) -> VecMap<Symbol, Alias> {
|
||||
|
@ -3022,8 +3021,8 @@ fn correct_mutual_recursive_type_alias<'a>(
|
|||
unsafe { VecMap::zip(symbols_introduced, aliases) }
|
||||
}
|
||||
|
||||
fn make_tag_union_of_alias_recursive<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn make_tag_union_of_alias_recursive(
|
||||
env: &mut Env<'_>,
|
||||
alias_name: Symbol,
|
||||
alias: &mut Alias,
|
||||
others: Vec<Symbol>,
|
||||
|
@ -3215,8 +3214,8 @@ fn make_tag_union_recursive_help<'a, 'b>(
|
|||
}
|
||||
}
|
||||
|
||||
fn mark_cyclic_alias<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn mark_cyclic_alias(
|
||||
env: &mut Env<'_>,
|
||||
typ: &mut Type,
|
||||
symbol: Symbol,
|
||||
alias_kind: AliasKind,
|
||||
|
|
|
@ -195,11 +195,11 @@ enum GeneratedInfo {
|
|||
}
|
||||
|
||||
impl GeneratedInfo {
|
||||
fn from_header_type<'a>(
|
||||
fn from_header_type(
|
||||
env: &mut Env,
|
||||
scope: &mut Scope,
|
||||
var_store: &mut VarStore,
|
||||
header_type: &HeaderType<'a>,
|
||||
header_type: &HeaderType<'_>,
|
||||
) -> Self {
|
||||
match header_type {
|
||||
HeaderType::Hosted {
|
||||
|
|
|
@ -321,8 +321,8 @@ pub fn canonicalize_def_header_pattern<'a>(
|
|||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub struct PermitShadows(pub bool);
|
||||
|
||||
fn canonicalize_pattern_symbol<'a>(
|
||||
env: &mut Env<'a>,
|
||||
fn canonicalize_pattern_symbol(
|
||||
env: &mut Env<'_>,
|
||||
scope: &mut Scope,
|
||||
output: &mut Output,
|
||||
region: Region,
|
||||
|
|
|
@ -122,7 +122,7 @@ pub fn walk_decls<V: Visitor>(visitor: &mut V, decls: &Declarations) {
|
|||
None => Pattern::Identifier(loc_symbol.value),
|
||||
};
|
||||
|
||||
let function_def = &decls.function_bodies[function_index.index() as usize];
|
||||
let function_def = &decls.function_bodies[function_index.index()];
|
||||
|
||||
DeclarationInfo::Function {
|
||||
loc_symbol,
|
||||
|
@ -133,7 +133,7 @@ pub fn walk_decls<V: Visitor>(visitor: &mut V, decls: &Declarations) {
|
|||
}
|
||||
}
|
||||
Destructure(destructure_index) => {
|
||||
let destructure = &decls.destructs[destructure_index.index() as usize];
|
||||
let destructure = &decls.destructs[destructure_index.index()];
|
||||
let loc_pattern = &destructure.loc_pattern;
|
||||
|
||||
let loc_expr = &decls.expressions[index];
|
||||
|
|
|
@ -2600,7 +2600,7 @@ pub fn constrain_decls(
|
|||
cycle_mark,
|
||||
);
|
||||
|
||||
index += length as usize;
|
||||
index += length;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,6 @@ pub(crate) fn derive_to_encoder(
|
|||
// Generalized tuple var so we can reuse this impl between many tuples:
|
||||
// if arity = n, this is (t1, ..., tn) for fresh t1, ..., tn.
|
||||
let flex_elems = (0..arity)
|
||||
.into_iter()
|
||||
.map(|idx| (idx as usize, env.subs.fresh_unnamed_flex_var()))
|
||||
.collect::<Vec<_>>();
|
||||
let elems = TupleElems::insert_into_subs(env.subs, flex_elems);
|
||||
|
|
|
@ -131,7 +131,6 @@ fn hash_tuple(env: &mut Env<'_>, fn_name: Symbol, arity: u32) -> (Variable, Expr
|
|||
// TODO: avoid an allocation here by pre-allocating the indices and variables `TupleElems`
|
||||
// will be instantiated with.
|
||||
let flex_elems: Vec<_> = (0..arity)
|
||||
.into_iter()
|
||||
.map(|i| (i as usize, env.subs.fresh_unnamed_flex_var()))
|
||||
.collect();
|
||||
let elems = TupleElems::insert_into_subs(env.subs, flex_elems);
|
||||
|
|
|
@ -65,15 +65,15 @@ impl Newlines {
|
|||
pub trait Formattable {
|
||||
fn is_multiline(&self) -> bool;
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
);
|
||||
|
||||
fn format<'buf>(&self, buf: &mut Buf<'buf>, indent: u16) {
|
||||
fn format(&self, buf: &mut Buf<'_>, indent: u16) {
|
||||
self.format_with_options(buf, Parens::NotNeeded, Newlines::No, indent);
|
||||
}
|
||||
}
|
||||
|
@ -87,9 +87,9 @@ where
|
|||
(*self).is_multiline()
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -97,7 +97,7 @@ where
|
|||
(*self).format_with_options(buf, parens, newlines, indent)
|
||||
}
|
||||
|
||||
fn format<'buf>(&self, buf: &mut Buf<'buf>, indent: u16) {
|
||||
fn format(&self, buf: &mut Buf<'_>, indent: u16) {
|
||||
(*self).format(buf, indent)
|
||||
}
|
||||
}
|
||||
|
@ -120,9 +120,9 @@ where
|
|||
self.value.is_multiline()
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -131,7 +131,7 @@ where
|
|||
.format_with_options(buf, parens, newlines, indent)
|
||||
}
|
||||
|
||||
fn format<'buf>(&self, buf: &mut Buf<'buf>, indent: u16) {
|
||||
fn format(&self, buf: &mut Buf<'_>, indent: u16) {
|
||||
self.value.format(buf, indent)
|
||||
}
|
||||
}
|
||||
|
@ -141,9 +141,9 @@ impl<'a> Formattable for UppercaseIdent<'a> {
|
|||
false
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
_indent: u16,
|
||||
|
@ -206,9 +206,9 @@ impl<'a> Formattable for TypeAnnotation<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -424,9 +424,9 @@ impl<'a> Formattable for AssignedField<'a, TypeAnnotation<'a>> {
|
|||
is_multiline_assigned_field_help(self)
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -441,9 +441,9 @@ impl<'a> Formattable for AssignedField<'a, Expr<'a>> {
|
|||
is_multiline_assigned_field_help(self)
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -466,9 +466,9 @@ fn is_multiline_assigned_field_help<T: Formattable>(afield: &AssignedField<'_, T
|
|||
}
|
||||
}
|
||||
|
||||
fn format_assigned_field_help<'a, 'buf, T>(
|
||||
zelf: &AssignedField<'a, T>,
|
||||
buf: &mut Buf<'buf>,
|
||||
fn format_assigned_field_help<T>(
|
||||
zelf: &AssignedField<'_, T>,
|
||||
buf: &mut Buf<'_>,
|
||||
indent: u16,
|
||||
separator_spaces: usize,
|
||||
is_multiline: bool,
|
||||
|
@ -545,9 +545,9 @@ impl<'a> Formattable for Tag<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -592,9 +592,9 @@ impl<'a> Formattable for HasClause<'a> {
|
|||
false
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -623,9 +623,9 @@ impl<'a> Formattable for HasImpls<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -662,9 +662,9 @@ impl<'a> Formattable for HasAbility<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -703,9 +703,9 @@ impl<'a> Formattable for HasAbilities<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
|
|
@ -15,9 +15,9 @@ impl<'a> Formattable for Defs<'a> {
|
|||
!self.tags.is_empty()
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -57,9 +57,9 @@ impl<'a> Formattable for TypeDef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -171,9 +171,9 @@ impl<'a> Formattable for TypeHeader<'a> {
|
|||
self.vars.iter().any(|v| v.is_multiline())
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -205,9 +205,9 @@ impl<'a> Formattable for ValueDef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -314,8 +314,8 @@ fn should_outdent(mut rhs: &TypeAnnotation) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_dbg_in_def<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_dbg_in_def<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
condition: &'a Loc<Expr<'a>>,
|
||||
is_multiline: bool,
|
||||
indent: u16,
|
||||
|
@ -335,8 +335,8 @@ fn fmt_dbg_in_def<'a, 'buf>(
|
|||
condition.format(buf, return_indent);
|
||||
}
|
||||
|
||||
fn fmt_expect<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_expect<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
condition: &'a Loc<Expr<'a>>,
|
||||
is_multiline: bool,
|
||||
indent: u16,
|
||||
|
@ -356,8 +356,8 @@ fn fmt_expect<'a, 'buf>(
|
|||
condition.format(buf, return_indent);
|
||||
}
|
||||
|
||||
fn fmt_expect_fx<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_expect_fx<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
condition: &'a Loc<Expr<'a>>,
|
||||
is_multiline: bool,
|
||||
indent: u16,
|
||||
|
@ -377,24 +377,24 @@ fn fmt_expect_fx<'a, 'buf>(
|
|||
condition.format(buf, return_indent);
|
||||
}
|
||||
|
||||
pub fn fmt_value_def<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
def: &roc_parse::ast::ValueDef<'a>,
|
||||
pub fn fmt_value_def(
|
||||
buf: &mut Buf<'_>,
|
||||
def: &roc_parse::ast::ValueDef<'_>,
|
||||
indent: u16,
|
||||
) {
|
||||
def.format(buf, indent);
|
||||
}
|
||||
|
||||
pub fn fmt_type_def<'a, 'buf>(buf: &mut Buf<'buf>, def: &roc_parse::ast::TypeDef<'a>, indent: u16) {
|
||||
pub fn fmt_type_def(buf: &mut Buf<'_>, def: &roc_parse::ast::TypeDef<'_>, indent: u16) {
|
||||
def.format(buf, indent);
|
||||
}
|
||||
|
||||
pub fn fmt_defs<'a, 'buf>(buf: &mut Buf<'buf>, defs: &Defs<'a>, indent: u16) {
|
||||
pub fn fmt_defs(buf: &mut Buf<'_>, defs: &Defs<'_>, indent: u16) {
|
||||
defs.format(buf, indent);
|
||||
}
|
||||
|
||||
pub fn fmt_body<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
pub fn fmt_body<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
pattern: &'a Pattern<'a>,
|
||||
body: &'a Expr<'a>,
|
||||
indent: u16,
|
||||
|
@ -462,9 +462,9 @@ impl<'a> Formattable for AbilityMember<'a> {
|
|||
self.name.value.is_multiline() || self.typ.is_multiline()
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
|
|
@ -103,9 +103,9 @@ impl<'a> Formattable for Expr<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -551,7 +551,7 @@ fn starts_with_newline(expr: &Expr) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_str_segment<'a, 'buf>(seg: &StrSegment<'a>, buf: &mut Buf<'buf>, indent: u16) {
|
||||
fn format_str_segment(seg: &StrSegment<'_>, buf: &mut Buf<'_>, indent: u16) {
|
||||
use StrSegment::*;
|
||||
|
||||
match seg {
|
||||
|
@ -614,7 +614,7 @@ fn push_op(buf: &mut Buf, op: BinOp) {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn fmt_str_literal<'buf>(buf: &mut Buf<'buf>, literal: StrLiteral, indent: u16) {
|
||||
pub fn fmt_str_literal(buf: &mut Buf<'_>, literal: StrLiteral, indent: u16) {
|
||||
use roc_parse::ast::StrLiteral::*;
|
||||
|
||||
match literal {
|
||||
|
@ -673,8 +673,8 @@ pub fn fmt_str_literal<'buf>(buf: &mut Buf<'buf>, literal: StrLiteral, indent: u
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_binops<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_binops<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
lefts: &'a [(Loc<Expr<'a>>, Loc<BinOp>)],
|
||||
loc_right_side: &'a Loc<Expr<'a>>,
|
||||
part_of_multi_line_binops: bool,
|
||||
|
@ -704,9 +704,9 @@ fn fmt_binops<'a, 'buf>(
|
|||
loc_right_side.format_with_options(buf, Parens::InOperator, Newlines::Yes, indent);
|
||||
}
|
||||
|
||||
fn format_spaces<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
spaces: &[CommentOrNewline<'a>],
|
||||
fn format_spaces(
|
||||
buf: &mut Buf<'_>,
|
||||
spaces: &[CommentOrNewline<'_>],
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
) {
|
||||
|
@ -738,8 +738,8 @@ fn is_when_patterns_multiline(when_branch: &WhenBranch) -> bool {
|
|||
is_multiline_patterns
|
||||
}
|
||||
|
||||
fn fmt_when<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_when<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
loc_condition: &'a Loc<Expr<'a>>,
|
||||
branches: &[&'a WhenBranch<'a>],
|
||||
indent: u16,
|
||||
|
@ -920,8 +920,8 @@ fn fmt_when<'a, 'buf>(
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_dbg<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_dbg<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
condition: &'a Loc<Expr<'a>>,
|
||||
continuation: &'a Loc<Expr<'a>>,
|
||||
is_multiline: bool,
|
||||
|
@ -947,8 +947,8 @@ fn fmt_dbg<'a, 'buf>(
|
|||
continuation.format(buf, indent);
|
||||
}
|
||||
|
||||
fn fmt_expect<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_expect<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
condition: &'a Loc<Expr<'a>>,
|
||||
continuation: &'a Loc<Expr<'a>>,
|
||||
is_multiline: bool,
|
||||
|
@ -974,8 +974,8 @@ fn fmt_expect<'a, 'buf>(
|
|||
continuation.format(buf, indent);
|
||||
}
|
||||
|
||||
fn fmt_if<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_if<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
branches: &'a [(Loc<Expr<'a>>, Loc<Expr<'a>>)],
|
||||
final_else: &'a Loc<Expr<'a>>,
|
||||
is_multiline: bool,
|
||||
|
@ -1123,8 +1123,8 @@ fn fmt_if<'a, 'buf>(
|
|||
final_else.format(buf, return_indent);
|
||||
}
|
||||
|
||||
fn fmt_closure<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_closure<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
loc_patterns: &'a [Loc<Pattern<'a>>],
|
||||
loc_ret: &'a Loc<Expr<'a>>,
|
||||
indent: u16,
|
||||
|
@ -1224,8 +1224,8 @@ fn fmt_closure<'a, 'buf>(
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_backpassing<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_backpassing<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
loc_patterns: &'a [Loc<Pattern<'a>>],
|
||||
loc_body: &'a Loc<Expr<'a>>,
|
||||
loc_ret: &'a Loc<Expr<'a>>,
|
||||
|
@ -1312,8 +1312,8 @@ fn pattern_needs_parens_when_backpassing(pat: &Pattern) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_record<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_record<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
update: Option<&'a Loc<Expr<'a>>>,
|
||||
fields: Collection<'a, Loc<AssignedField<'a, Expr<'a>>>>,
|
||||
indent: u16,
|
||||
|
@ -1404,9 +1404,9 @@ fn fmt_record<'a, 'buf>(
|
|||
}
|
||||
}
|
||||
|
||||
fn format_field_multiline<'a, 'buf, T>(
|
||||
buf: &mut Buf<'buf>,
|
||||
field: &AssignedField<'a, T>,
|
||||
fn format_field_multiline<T>(
|
||||
buf: &mut Buf<'_>,
|
||||
field: &AssignedField<'_, T>,
|
||||
indent: u16,
|
||||
separator_prefix: &str,
|
||||
) where
|
||||
|
|
|
@ -44,9 +44,9 @@ macro_rules! keywords {
|
|||
false
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: crate::annotation::Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -86,9 +86,9 @@ impl<V: Formattable> Formattable for Option<V> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: crate::annotation::Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -111,9 +111,9 @@ impl<'a> Formattable for ProvidesTo<'a> {
|
|||
|| self.to_keyword.is_multiline()
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: crate::annotation::Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -130,9 +130,9 @@ impl<'a> Formattable for PlatformRequires<'a> {
|
|||
is_collection_multiline(&self.rigids) || self.signature.is_multiline()
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: crate::annotation::Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -146,9 +146,9 @@ impl<'a, V: Formattable> Formattable for Spaces<'a, V> {
|
|||
!self.before.is_empty() || !self.after.is_empty() || self.item.is_multiline()
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: crate::annotation::Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -164,9 +164,9 @@ impl<'a, K: Formattable, V: Formattable> Formattable for KeywordItem<'a, K, V> {
|
|||
self.keyword.is_multiline() || self.item.is_multiline()
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -177,7 +177,7 @@ impl<'a, K: Formattable, V: Formattable> Formattable for KeywordItem<'a, K, V> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn fmt_interface_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a InterfaceHeader<'a>) {
|
||||
pub fn fmt_interface_header<'a>(buf: &mut Buf<'_>, header: &'a InterfaceHeader<'a>) {
|
||||
buf.indent(0);
|
||||
buf.push_str("interface");
|
||||
let indent = INDENT;
|
||||
|
@ -193,7 +193,7 @@ pub fn fmt_interface_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a Interface
|
|||
fmt_imports(buf, header.imports.item, indent);
|
||||
}
|
||||
|
||||
pub fn fmt_hosted_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a HostedHeader<'a>) {
|
||||
pub fn fmt_hosted_header<'a>(buf: &mut Buf<'_>, header: &'a HostedHeader<'a>) {
|
||||
buf.indent(0);
|
||||
buf.push_str("hosted");
|
||||
let indent = INDENT;
|
||||
|
@ -210,7 +210,7 @@ pub fn fmt_hosted_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a HostedHeader
|
|||
fmt_exposes(buf, header.generates_with.item, indent);
|
||||
}
|
||||
|
||||
pub fn fmt_app_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a AppHeader<'a>) {
|
||||
pub fn fmt_app_header<'a>(buf: &mut Buf<'_>, header: &'a AppHeader<'a>) {
|
||||
buf.indent(0);
|
||||
buf.push_str("app");
|
||||
let indent = INDENT;
|
||||
|
@ -229,7 +229,7 @@ pub fn fmt_app_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a AppHeader<'a>)
|
|||
header.provides.format(buf, indent);
|
||||
}
|
||||
|
||||
pub fn fmt_package_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a PackageHeader<'a>) {
|
||||
pub fn fmt_package_header<'a>(buf: &mut Buf<'_>, header: &'a PackageHeader<'a>) {
|
||||
buf.indent(0);
|
||||
buf.push_str("package");
|
||||
let indent = INDENT;
|
||||
|
@ -243,7 +243,7 @@ pub fn fmt_package_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a PackageHead
|
|||
fmt_packages(buf, header.packages.item, indent);
|
||||
}
|
||||
|
||||
pub fn fmt_platform_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a PlatformHeader<'a>) {
|
||||
pub fn fmt_platform_header<'a>(buf: &mut Buf<'_>, header: &'a PlatformHeader<'a>) {
|
||||
buf.indent(0);
|
||||
buf.push_str("platform");
|
||||
let indent = INDENT;
|
||||
|
@ -262,7 +262,7 @@ pub fn fmt_platform_header<'a, 'buf>(buf: &mut Buf<'buf>, header: &'a PlatformHe
|
|||
fmt_provides(buf, header.provides.item, None, indent);
|
||||
}
|
||||
|
||||
fn fmt_requires<'a, 'buf>(buf: &mut Buf<'buf>, requires: &PlatformRequires<'a>, indent: u16) {
|
||||
fn fmt_requires(buf: &mut Buf<'_>, requires: &PlatformRequires<'_>, indent: u16) {
|
||||
fmt_collection(buf, indent, Braces::Curly, requires.rigids, Newlines::No);
|
||||
|
||||
buf.push_str(" {");
|
||||
|
@ -276,9 +276,9 @@ impl<'a> Formattable for TypedIdent<'a> {
|
|||
false
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -293,7 +293,7 @@ impl<'a> Formattable for TypedIdent<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_package_name<'buf>(buf: &mut Buf<'buf>, name: PackageName, indent: u16) {
|
||||
fn fmt_package_name(buf: &mut Buf<'_>, name: PackageName, indent: u16) {
|
||||
buf.indent(indent);
|
||||
buf.push('"');
|
||||
buf.push_str_allow_spaces(name.to_str());
|
||||
|
@ -312,9 +312,9 @@ impl<'a, T: Formattable> Formattable for Spaced<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: crate::annotation::Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -335,16 +335,16 @@ impl<'a, T: Formattable> Formattable for Spaced<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_imports<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_imports<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
loc_entries: Collection<'a, Loc<Spaced<'a, ImportsEntry<'a>>>>,
|
||||
indent: u16,
|
||||
) {
|
||||
fmt_collection(buf, indent, Braces::Square, loc_entries, Newlines::No)
|
||||
}
|
||||
|
||||
fn fmt_provides<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_provides<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
loc_exposed_names: Collection<'a, Loc<Spaced<'a, ExposedName<'a>>>>,
|
||||
loc_provided_types: Option<Collection<'a, Loc<Spaced<'a, UppercaseIdent<'a>>>>>,
|
||||
indent: u16,
|
||||
|
@ -356,7 +356,7 @@ fn fmt_provides<'a, 'buf>(
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_to<'buf>(buf: &mut Buf<'buf>, to: To, indent: u16) {
|
||||
fn fmt_to(buf: &mut Buf<'_>, to: To, indent: u16) {
|
||||
match to {
|
||||
To::ExistingPackage(name) => {
|
||||
buf.push_str(name);
|
||||
|
@ -365,8 +365,8 @@ fn fmt_to<'buf>(buf: &mut Buf<'buf>, to: To, indent: u16) {
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_exposes<'buf, N: Formattable + Copy + core::fmt::Debug>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_exposes<N: Formattable + Copy + core::fmt::Debug>(
|
||||
buf: &mut Buf<'_>,
|
||||
loc_entries: Collection<'_, Loc<Spaced<'_, N>>>,
|
||||
indent: u16,
|
||||
) {
|
||||
|
@ -374,17 +374,17 @@ fn fmt_exposes<'buf, N: Formattable + Copy + core::fmt::Debug>(
|
|||
}
|
||||
|
||||
pub trait FormatName {
|
||||
fn format<'buf>(&self, buf: &mut Buf<'buf>);
|
||||
fn format(&self, buf: &mut Buf<'_>);
|
||||
}
|
||||
|
||||
impl<'a> FormatName for &'a str {
|
||||
fn format<'buf>(&self, buf: &mut Buf<'buf>) {
|
||||
fn format(&self, buf: &mut Buf<'_>) {
|
||||
buf.push_str(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FormatName for ModuleName<'a> {
|
||||
fn format<'buf>(&self, buf: &mut Buf<'buf>) {
|
||||
fn format(&self, buf: &mut Buf<'_>) {
|
||||
buf.push_str(self.as_str());
|
||||
}
|
||||
}
|
||||
|
@ -394,9 +394,9 @@ impl<'a> Formattable for ModuleName<'a> {
|
|||
false
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
_indent: u16,
|
||||
|
@ -410,9 +410,9 @@ impl<'a> Formattable for ExposedName<'a> {
|
|||
false
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -423,13 +423,13 @@ impl<'a> Formattable for ExposedName<'a> {
|
|||
}
|
||||
|
||||
impl<'a> FormatName for ExposedName<'a> {
|
||||
fn format<'buf>(&self, buf: &mut Buf<'buf>) {
|
||||
fn format(&self, buf: &mut Buf<'_>) {
|
||||
buf.push_str(self.as_str());
|
||||
}
|
||||
}
|
||||
|
||||
fn fmt_packages<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
fn fmt_packages<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
loc_entries: Collection<'a, Loc<Spaced<'a, PackageEntry<'a>>>>,
|
||||
indent: u16,
|
||||
) {
|
||||
|
@ -441,9 +441,9 @@ impl<'a> Formattable for PackageEntry<'a> {
|
|||
false
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -457,9 +457,9 @@ impl<'a> Formattable for ImportsEntry<'a> {
|
|||
false
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -467,14 +467,14 @@ impl<'a> Formattable for ImportsEntry<'a> {
|
|||
fmt_imports_entry(buf, self, indent);
|
||||
}
|
||||
}
|
||||
fn fmt_packages_entry<'a, 'buf>(buf: &mut Buf<'buf>, entry: &PackageEntry<'a>, indent: u16) {
|
||||
fn fmt_packages_entry(buf: &mut Buf<'_>, entry: &PackageEntry<'_>, indent: u16) {
|
||||
buf.push_str(entry.shorthand);
|
||||
buf.push(':');
|
||||
fmt_default_spaces(buf, entry.spaces_after_shorthand, indent);
|
||||
fmt_package_name(buf, entry.package_name.value, indent);
|
||||
}
|
||||
|
||||
fn fmt_imports_entry<'a, 'buf>(buf: &mut Buf<'buf>, entry: &ImportsEntry<'a>, indent: u16) {
|
||||
fn fmt_imports_entry(buf: &mut Buf<'_>, entry: &ImportsEntry<'_>, indent: u16) {
|
||||
use roc_parse::header::ImportsEntry::*;
|
||||
|
||||
buf.indent(indent);
|
||||
|
|
|
@ -4,8 +4,8 @@ use crate::spaces::{fmt_comments_only, fmt_spaces, NewlineAt, INDENT};
|
|||
use crate::Buf;
|
||||
use roc_parse::ast::{Base, CommentOrNewline, Pattern, PatternAs};
|
||||
|
||||
pub fn fmt_pattern<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
pub fn fmt_pattern<'a>(
|
||||
buf: &mut Buf<'_>,
|
||||
pattern: &'a Pattern<'a>,
|
||||
indent: u16,
|
||||
parens: Parens,
|
||||
|
@ -18,9 +18,9 @@ impl<'a> Formattable for PatternAs<'a> {
|
|||
self.spaces_before.iter().any(|s| s.is_comment())
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
_parens: Parens,
|
||||
_newlines: Newlines,
|
||||
indent: u16,
|
||||
|
@ -85,9 +85,9 @@ impl<'a> Formattable for Pattern<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn format_with_options<'buf>(
|
||||
fn format_with_options(
|
||||
&self,
|
||||
buf: &mut Buf<'buf>,
|
||||
buf: &mut Buf<'_>,
|
||||
parens: Parens,
|
||||
newlines: Newlines,
|
||||
indent: u16,
|
||||
|
|
|
@ -21,9 +21,9 @@ use crate::{Ast, Buf};
|
|||
/// The number of spaces to indent.
|
||||
pub const INDENT: u16 = 4;
|
||||
|
||||
pub fn fmt_default_spaces<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
spaces: &[CommentOrNewline<'a>],
|
||||
pub fn fmt_default_spaces(
|
||||
buf: &mut Buf<'_>,
|
||||
spaces: &[CommentOrNewline<'_>],
|
||||
indent: u16,
|
||||
) {
|
||||
if spaces.is_empty() {
|
||||
|
@ -32,9 +32,9 @@ pub fn fmt_default_spaces<'a, 'buf>(
|
|||
fmt_spaces(buf, spaces.iter(), indent);
|
||||
}
|
||||
}
|
||||
pub fn fmt_default_newline<'a, 'buf>(
|
||||
buf: &mut Buf<'buf>,
|
||||
spaces: &[CommentOrNewline<'a>],
|
||||
pub fn fmt_default_newline(
|
||||
buf: &mut Buf<'_>,
|
||||
spaces: &[CommentOrNewline<'_>],
|
||||
indent: u16,
|
||||
) {
|
||||
if spaces.is_empty() {
|
||||
|
@ -153,7 +153,7 @@ pub fn fmt_comments_only<'a, 'buf, I>(
|
|||
}
|
||||
}
|
||||
|
||||
fn fmt_comment<'buf>(buf: &mut Buf<'buf>, comment: &str) {
|
||||
fn fmt_comment(buf: &mut Buf<'_>, comment: &str) {
|
||||
// The '#' in a comment should always be preceded by a newline or a space,
|
||||
// unless it's the very beginning of the buffer.
|
||||
if !buf.is_empty() && !buf.ends_with_space() && !buf.ends_with_newline() {
|
||||
|
@ -192,7 +192,7 @@ where
|
|||
count
|
||||
}
|
||||
|
||||
fn fmt_docs<'buf>(buf: &mut Buf<'buf>, docs: &str) {
|
||||
fn fmt_docs(buf: &mut Buf<'_>, docs: &str) {
|
||||
// The "##" in a doc comment should always be preceded by a newline or a space,
|
||||
// unless it's the very beginning of the buffer.
|
||||
if !buf.is_empty() && !buf.ends_with_space() && !buf.ends_with_newline() {
|
||||
|
|
|
@ -385,11 +385,11 @@ impl CallConv<AArch64GeneralReg, AArch64FloatReg, AArch64Assembler> for AArch64C
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn load_args<'a, 'r>(
|
||||
fn load_args<'a>(
|
||||
_buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
AArch64GeneralReg,
|
||||
AArch64FloatReg,
|
||||
AArch64Assembler,
|
||||
|
@ -403,11 +403,11 @@ impl CallConv<AArch64GeneralReg, AArch64FloatReg, AArch64Assembler> for AArch64C
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn store_args<'a, 'r>(
|
||||
fn store_args<'a>(
|
||||
_buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
AArch64GeneralReg,
|
||||
AArch64FloatReg,
|
||||
AArch64Assembler,
|
||||
|
@ -422,11 +422,11 @@ impl CallConv<AArch64GeneralReg, AArch64FloatReg, AArch64Assembler> for AArch64C
|
|||
todo!("Storing args for AArch64");
|
||||
}
|
||||
|
||||
fn return_complex_symbol<'a, 'r>(
|
||||
fn return_complex_symbol<'a>(
|
||||
_buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
AArch64GeneralReg,
|
||||
AArch64FloatReg,
|
||||
AArch64Assembler,
|
||||
|
@ -439,11 +439,11 @@ impl CallConv<AArch64GeneralReg, AArch64FloatReg, AArch64Assembler> for AArch64C
|
|||
todo!("Returning complex symbols for AArch64");
|
||||
}
|
||||
|
||||
fn load_returned_complex_symbol<'a, 'r>(
|
||||
fn load_returned_complex_symbol<'a>(
|
||||
_buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
AArch64GeneralReg,
|
||||
AArch64FloatReg,
|
||||
AArch64Assembler,
|
||||
|
@ -532,9 +532,9 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
|||
mul_reg64_reg64_reg64(buf, dst, src1, src2);
|
||||
}
|
||||
|
||||
fn umul_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn umul_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<'a, 'r, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
_storage_manager: &mut StorageManager<'a, '_, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
dst: AArch64GeneralReg,
|
||||
src1: AArch64GeneralReg,
|
||||
src2: AArch64GeneralReg,
|
||||
|
@ -545,9 +545,9 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
|||
mul_reg64_reg64_reg64(buf, dst, src1, src2);
|
||||
}
|
||||
|
||||
fn idiv_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn idiv_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<'a, 'r, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
_storage_manager: &mut StorageManager<'a, '_, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
dst: AArch64GeneralReg,
|
||||
src1: AArch64GeneralReg,
|
||||
src2: AArch64GeneralReg,
|
||||
|
@ -558,9 +558,9 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
|||
sdiv_reg64_reg64_reg64(buf, dst, src1, src2);
|
||||
}
|
||||
|
||||
fn udiv_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn udiv_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<'a, 'r, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
_storage_manager: &mut StorageManager<'a, '_, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
dst: AArch64GeneralReg,
|
||||
src1: AArch64GeneralReg,
|
||||
src2: AArch64GeneralReg,
|
||||
|
@ -1096,9 +1096,9 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
|||
eor_reg64_reg64_reg64(buf, dst, src1, src2);
|
||||
}
|
||||
|
||||
fn shl_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn shl_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<'a, 'r, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
_storage_manager: &mut StorageManager<'a, '_, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
dst: AArch64GeneralReg,
|
||||
src1: AArch64GeneralReg,
|
||||
src2: AArch64GeneralReg,
|
||||
|
@ -1109,9 +1109,9 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
|||
lsl_reg64_reg64_reg64(buf, dst, src1, src2);
|
||||
}
|
||||
|
||||
fn shr_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn shr_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<'a, 'r, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
_storage_manager: &mut StorageManager<'a, '_, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
dst: AArch64GeneralReg,
|
||||
src1: AArch64GeneralReg,
|
||||
src2: AArch64GeneralReg,
|
||||
|
@ -1122,9 +1122,9 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
|||
lsr_reg64_reg64_reg64(buf, dst, src1, src2);
|
||||
}
|
||||
|
||||
fn sar_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn sar_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<'a, 'r, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
_storage_manager: &mut StorageManager<'a, '_, AArch64GeneralReg, AArch64FloatReg, ASM, CC>,
|
||||
dst: AArch64GeneralReg,
|
||||
src1: AArch64GeneralReg,
|
||||
src2: AArch64GeneralReg,
|
||||
|
|
|
@ -62,15 +62,15 @@ pub trait CallConv<GeneralReg: RegTrait, FloatReg: RegTrait, ASM: Assembler<Gene
|
|||
!Self::float_callee_saved(reg)
|
||||
}
|
||||
|
||||
fn setup_stack<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
fn setup_stack(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
general_saved_regs: &[GeneralReg],
|
||||
float_saved_regs: &[FloatReg],
|
||||
requested_stack_size: i32,
|
||||
fn_call_stack_size: i32,
|
||||
) -> i32;
|
||||
fn cleanup_stack<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
fn cleanup_stack(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
general_saved_regs: &[GeneralReg],
|
||||
float_saved_regs: &[FloatReg],
|
||||
aligned_stack_size: i32,
|
||||
|
@ -78,9 +78,9 @@ pub trait CallConv<GeneralReg: RegTrait, FloatReg: RegTrait, ASM: Assembler<Gene
|
|||
);
|
||||
|
||||
/// load_args updates the storage manager to know where every arg is stored.
|
||||
fn load_args<'a, 'r>(
|
||||
fn load_args<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, Self>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, Self>,
|
||||
layout_interner: &mut STLayoutInterner<'a>,
|
||||
args: &'a [(InLayout<'a>, Symbol)],
|
||||
// ret_layout is needed because if it is a complex type, we pass a pointer as the first arg.
|
||||
|
@ -89,9 +89,9 @@ pub trait CallConv<GeneralReg: RegTrait, FloatReg: RegTrait, ASM: Assembler<Gene
|
|||
|
||||
/// store_args stores the args in registers and on the stack for function calling.
|
||||
/// It also updates the amount of temporary stack space needed in the storage manager.
|
||||
fn store_args<'a, 'r>(
|
||||
fn store_args<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, Self>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, Self>,
|
||||
layout_interner: &mut STLayoutInterner<'a>,
|
||||
dst: &Symbol,
|
||||
args: &[Symbol],
|
||||
|
@ -102,9 +102,9 @@ pub trait CallConv<GeneralReg: RegTrait, FloatReg: RegTrait, ASM: Assembler<Gene
|
|||
|
||||
/// return_complex_symbol returns the specified complex/non-primative symbol.
|
||||
/// It uses the layout to determine how the data should be returned.
|
||||
fn return_complex_symbol<'a, 'r>(
|
||||
fn return_complex_symbol<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, Self>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, Self>,
|
||||
layout_interner: &mut STLayoutInterner<'a>,
|
||||
sym: &Symbol,
|
||||
layout: &InLayout<'a>,
|
||||
|
@ -112,9 +112,9 @@ pub trait CallConv<GeneralReg: RegTrait, FloatReg: RegTrait, ASM: Assembler<Gene
|
|||
|
||||
/// load_returned_complex_symbol loads a complex symbol that was returned from a function call.
|
||||
/// It uses the layout to determine how the data should be loaded into the symbol.
|
||||
fn load_returned_complex_symbol<'a, 'r>(
|
||||
fn load_returned_complex_symbol<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, Self>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, Self>,
|
||||
layout_interner: &mut STLayoutInterner<'a>,
|
||||
sym: &Symbol,
|
||||
layout: &InLayout<'a>,
|
||||
|
@ -184,9 +184,9 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
|
|||
src2: GeneralReg,
|
||||
);
|
||||
|
||||
fn shl_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn shl_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, CC>,
|
||||
dst: GeneralReg,
|
||||
src1: GeneralReg,
|
||||
src2: GeneralReg,
|
||||
|
@ -194,9 +194,9 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
|
|||
ASM: Assembler<GeneralReg, FloatReg>,
|
||||
CC: CallConv<GeneralReg, FloatReg, ASM>;
|
||||
|
||||
fn shr_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn shr_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, CC>,
|
||||
dst: GeneralReg,
|
||||
src1: GeneralReg,
|
||||
src2: GeneralReg,
|
||||
|
@ -204,9 +204,9 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
|
|||
ASM: Assembler<GeneralReg, FloatReg>,
|
||||
CC: CallConv<GeneralReg, FloatReg, ASM>;
|
||||
|
||||
fn sar_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn sar_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, CC>,
|
||||
dst: GeneralReg,
|
||||
src1: GeneralReg,
|
||||
src2: GeneralReg,
|
||||
|
@ -359,9 +359,9 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
|
|||
src1: GeneralReg,
|
||||
src2: GeneralReg,
|
||||
);
|
||||
fn umul_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn umul_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, CC>,
|
||||
dst: GeneralReg,
|
||||
src1: GeneralReg,
|
||||
src2: GeneralReg,
|
||||
|
@ -369,18 +369,18 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
|
|||
ASM: Assembler<GeneralReg, FloatReg>,
|
||||
CC: CallConv<GeneralReg, FloatReg, ASM>;
|
||||
|
||||
fn idiv_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn idiv_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, CC>,
|
||||
dst: GeneralReg,
|
||||
src1: GeneralReg,
|
||||
src2: GeneralReg,
|
||||
) where
|
||||
ASM: Assembler<GeneralReg, FloatReg>,
|
||||
CC: CallConv<GeneralReg, FloatReg, ASM>;
|
||||
fn udiv_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn udiv_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, GeneralReg, FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, GeneralReg, FloatReg, ASM, CC>,
|
||||
dst: GeneralReg,
|
||||
src1: GeneralReg,
|
||||
src2: GeneralReg,
|
||||
|
@ -1776,7 +1776,7 @@ impl<
|
|||
self.storage_manager.with_tmp_general_reg(
|
||||
&mut self.buf,
|
||||
|storage_manager, buf, list_ptr| {
|
||||
ASM::mov_reg64_base32(buf, list_ptr, base_offset as i32);
|
||||
ASM::mov_reg64_base32(buf, list_ptr, base_offset);
|
||||
storage_manager.with_tmp_general_reg(buf, |storage_manager, buf, tmp| {
|
||||
// calculate `element_width * index`
|
||||
ASM::mov_reg64_imm64(buf, tmp, ret_stack_size as i64);
|
||||
|
|
|
@ -216,8 +216,8 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn setup_stack<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
fn setup_stack(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
saved_general_regs: &[X86_64GeneralReg],
|
||||
saved_float_regs: &[X86_64FloatReg],
|
||||
requested_stack_size: i32,
|
||||
|
@ -233,8 +233,8 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn cleanup_stack<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
fn cleanup_stack(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
saved_general_regs: &[X86_64GeneralReg],
|
||||
saved_float_regs: &[X86_64FloatReg],
|
||||
aligned_stack_size: i32,
|
||||
|
@ -250,11 +250,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn load_args<'a, 'r>(
|
||||
fn load_args<'a>(
|
||||
_buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
X86_64GeneralReg,
|
||||
X86_64FloatReg,
|
||||
X86_64Assembler,
|
||||
|
@ -284,11 +284,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn store_args<'a, 'r>(
|
||||
fn store_args<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
X86_64GeneralReg,
|
||||
X86_64FloatReg,
|
||||
X86_64Assembler,
|
||||
|
@ -330,11 +330,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
|
|||
storage_manager.update_fn_call_stack_size(state.tmp_stack_offset as u32);
|
||||
}
|
||||
|
||||
fn return_complex_symbol<'a, 'r>(
|
||||
fn return_complex_symbol<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
X86_64GeneralReg,
|
||||
X86_64FloatReg,
|
||||
X86_64Assembler,
|
||||
|
@ -388,11 +388,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
|
|||
}
|
||||
}
|
||||
|
||||
fn load_returned_complex_symbol<'a, 'r>(
|
||||
fn load_returned_complex_symbol<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
X86_64GeneralReg,
|
||||
X86_64FloatReg,
|
||||
X86_64Assembler,
|
||||
|
@ -447,10 +447,10 @@ impl X64_64SystemVStoreArgs {
|
|||
const FLOAT_PARAM_REGS: &'static [X86_64FloatReg] = X86_64SystemV::FLOAT_PARAM_REGS;
|
||||
const FLOAT_RETURN_REGS: &'static [X86_64FloatReg] = X86_64SystemV::FLOAT_RETURN_REGS;
|
||||
|
||||
fn store_arg<'a, 'r>(
|
||||
fn store_arg<'a>(
|
||||
&mut self,
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, '_, X86_64SystemV>,
|
||||
layout_interner: &mut STLayoutInterner<'a>,
|
||||
sym: Symbol,
|
||||
in_layout: InLayout<'a>,
|
||||
|
@ -537,10 +537,10 @@ impl X64_64SystemVStoreArgs {
|
|||
}
|
||||
}
|
||||
|
||||
fn store_arg_general<'a, 'r>(
|
||||
fn store_arg_general<'a>(
|
||||
&mut self,
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, '_, X86_64SystemV>,
|
||||
sym: Symbol,
|
||||
) {
|
||||
if self.general_i < Self::GENERAL_PARAM_REGS.len() {
|
||||
|
@ -562,10 +562,10 @@ impl X64_64SystemVStoreArgs {
|
|||
}
|
||||
}
|
||||
|
||||
fn store_arg_float<'a, 'r>(
|
||||
fn store_arg_float<'a>(
|
||||
&mut self,
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, '_, X86_64SystemV>,
|
||||
sym: Symbol,
|
||||
) {
|
||||
if self.float_i < Self::FLOAT_PARAM_REGS.len() {
|
||||
|
@ -598,9 +598,9 @@ type X86_64StorageManager<'a, 'r, CallConv> =
|
|||
StorageManager<'a, 'r, X86_64GeneralReg, X86_64FloatReg, X86_64Assembler, CallConv>;
|
||||
|
||||
impl X64_64SystemVLoadArgs {
|
||||
fn load_arg<'a, 'r>(
|
||||
fn load_arg<'a>(
|
||||
&mut self,
|
||||
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, '_, X86_64SystemV>,
|
||||
layout_interner: &mut STLayoutInterner<'a>,
|
||||
sym: Symbol,
|
||||
in_layout: InLayout<'a>,
|
||||
|
@ -645,9 +645,9 @@ impl X64_64SystemVLoadArgs {
|
|||
}
|
||||
}
|
||||
|
||||
fn load_arg_general<'a, 'r>(
|
||||
fn load_arg_general(
|
||||
&mut self,
|
||||
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>,
|
||||
storage_manager: &mut X86_64StorageManager<'_, '_, X86_64SystemV>,
|
||||
sym: Symbol,
|
||||
) {
|
||||
if self.general_i < X86_64SystemV::GENERAL_PARAM_REGS.len() {
|
||||
|
@ -660,9 +660,9 @@ impl X64_64SystemVLoadArgs {
|
|||
}
|
||||
}
|
||||
|
||||
fn load_arg_float<'a, 'r>(
|
||||
fn load_arg_float(
|
||||
&mut self,
|
||||
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>,
|
||||
storage_manager: &mut X86_64StorageManager<'_, '_, X86_64SystemV>,
|
||||
sym: Symbol,
|
||||
) {
|
||||
if self.general_i < X86_64SystemV::GENERAL_PARAM_REGS.len() {
|
||||
|
@ -783,8 +783,8 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn setup_stack<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
fn setup_stack(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
saved_general_regs: &[X86_64GeneralReg],
|
||||
saved_float_regs: &[X86_64FloatReg],
|
||||
requested_stack_size: i32,
|
||||
|
@ -800,8 +800,8 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn cleanup_stack<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
fn cleanup_stack(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
saved_general_regs: &[X86_64GeneralReg],
|
||||
saved_float_regs: &[X86_64FloatReg],
|
||||
aligned_stack_size: i32,
|
||||
|
@ -817,9 +817,9 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn load_args<'a, 'r>(
|
||||
fn load_args<'a>(
|
||||
_buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64WindowsFastcall>,
|
||||
storage_manager: &mut X86_64StorageManager<'a, '_, X86_64WindowsFastcall>,
|
||||
layout_interner: &mut STLayoutInterner<'a>,
|
||||
args: &'a [(InLayout<'a>, Symbol)],
|
||||
ret_layout: &InLayout<'a>,
|
||||
|
@ -861,11 +861,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn store_args<'a, 'r>(
|
||||
fn store_args<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
X86_64GeneralReg,
|
||||
X86_64FloatReg,
|
||||
X86_64Assembler,
|
||||
|
@ -938,11 +938,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
|
|||
storage_manager.update_fn_call_stack_size(tmp_stack_offset as u32);
|
||||
}
|
||||
|
||||
fn return_complex_symbol<'a, 'r>(
|
||||
fn return_complex_symbol<'a>(
|
||||
_buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
X86_64GeneralReg,
|
||||
X86_64FloatReg,
|
||||
X86_64Assembler,
|
||||
|
@ -955,11 +955,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
|
|||
todo!("Returning complex symbols for X86_64");
|
||||
}
|
||||
|
||||
fn load_returned_complex_symbol<'a, 'r>(
|
||||
fn load_returned_complex_symbol<'a>(
|
||||
_buf: &mut Vec<'a, u8>,
|
||||
_storage_manager: &mut StorageManager<
|
||||
'a,
|
||||
'r,
|
||||
'_,
|
||||
X86_64GeneralReg,
|
||||
X86_64FloatReg,
|
||||
X86_64Assembler,
|
||||
|
@ -985,8 +985,8 @@ impl X86_64WindowsFastcall {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn x86_64_generic_setup_stack<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
fn x86_64_generic_setup_stack(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
saved_general_regs: &[X86_64GeneralReg],
|
||||
saved_float_regs: &[X86_64FloatReg],
|
||||
requested_stack_size: i32,
|
||||
|
@ -1042,8 +1042,8 @@ fn x86_64_generic_setup_stack<'a>(
|
|||
|
||||
#[inline(always)]
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn x86_64_generic_cleanup_stack<'a>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
fn x86_64_generic_cleanup_stack(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
saved_general_regs: &[X86_64GeneralReg],
|
||||
saved_float_regs: &[X86_64FloatReg],
|
||||
aligned_stack_size: i32,
|
||||
|
@ -1183,9 +1183,9 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
|||
imul_reg64_reg64(buf, dst, src2);
|
||||
}
|
||||
|
||||
fn umul_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn umul_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
dst: X86_64GeneralReg,
|
||||
src1: X86_64GeneralReg,
|
||||
src2: X86_64GeneralReg,
|
||||
|
@ -1267,9 +1267,9 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
|||
}
|
||||
}
|
||||
|
||||
fn idiv_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn idiv_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
dst: X86_64GeneralReg,
|
||||
src1: X86_64GeneralReg,
|
||||
src2: X86_64GeneralReg,
|
||||
|
@ -1287,9 +1287,9 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
|||
mov_reg64_reg64(buf, dst, X86_64GeneralReg::RAX);
|
||||
}
|
||||
|
||||
fn udiv_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn udiv_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
dst: X86_64GeneralReg,
|
||||
src1: X86_64GeneralReg,
|
||||
src2: X86_64GeneralReg,
|
||||
|
@ -1734,9 +1734,9 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
|||
binop_move_src_to_dst_reg64(buf, xor_reg64_reg64, dst, src1, src2)
|
||||
}
|
||||
|
||||
fn shl_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn shl_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
dst: X86_64GeneralReg,
|
||||
src1: X86_64GeneralReg,
|
||||
src2: X86_64GeneralReg,
|
||||
|
@ -1747,9 +1747,9 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
|||
shift_reg64_reg64_reg64(buf, storage_manager, shl_reg64_reg64, dst, src1, src2)
|
||||
}
|
||||
|
||||
fn shr_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn shr_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
dst: X86_64GeneralReg,
|
||||
src1: X86_64GeneralReg,
|
||||
src2: X86_64GeneralReg,
|
||||
|
@ -1760,9 +1760,9 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
|||
shift_reg64_reg64_reg64(buf, storage_manager, shr_reg64_reg64, dst, src1, src2)
|
||||
}
|
||||
|
||||
fn sar_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
||||
fn sar_reg64_reg64_reg64<'a, ASM, CC>(
|
||||
buf: &mut Vec<'a, u8>,
|
||||
storage_manager: &mut StorageManager<'a, 'r, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
storage_manager: &mut StorageManager<'a, '_, X86_64GeneralReg, X86_64FloatReg, ASM, CC>,
|
||||
dst: X86_64GeneralReg,
|
||||
src1: X86_64GeneralReg,
|
||||
src2: X86_64GeneralReg,
|
||||
|
|
|
@ -885,7 +885,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
|
|||
self.code_builder.f32_eq();
|
||||
}
|
||||
ValueType::F64 => {
|
||||
self.code_builder.f64_const(f64::from_bits(*value as u64));
|
||||
self.code_builder.f64_const(f64::from_bits(*value));
|
||||
self.code_builder.f64_eq();
|
||||
}
|
||||
}
|
||||
|
@ -1114,7 +1114,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
|
|||
match storage {
|
||||
StoredValue::VirtualMachineStack { value_type, .. } => {
|
||||
match (lit, value_type) {
|
||||
(Literal::Float(x), ValueType::F64) => self.code_builder.f64_const(*x as f64),
|
||||
(Literal::Float(x), ValueType::F64) => self.code_builder.f64_const(*x),
|
||||
(Literal::Float(x), ValueType::F32) => self.code_builder.f32_const(*x as f32),
|
||||
(Literal::Int(x), ValueType::I64) => {
|
||||
self.code_builder.i64_const(i128::from_ne_bytes(*x) as i64)
|
||||
|
|
|
@ -506,7 +506,7 @@ impl<'a> CodeBuilder<'a> {
|
|||
stack_size
|
||||
);
|
||||
|
||||
let new_len = stack_size - pops as usize;
|
||||
let new_len = stack_size - pops;
|
||||
current_stack.truncate(new_len);
|
||||
if push {
|
||||
current_stack.push(Symbol::WASM_TMP);
|
||||
|
|
|
@ -2347,8 +2347,8 @@ macro_rules! debug_check_ir {
|
|||
}
|
||||
|
||||
/// Report modules that are imported, but from which nothing is used
|
||||
fn report_unused_imported_modules<'a>(
|
||||
state: &mut State<'a>,
|
||||
fn report_unused_imported_modules(
|
||||
state: &mut State<'_>,
|
||||
module_id: ModuleId,
|
||||
constrained_module: &ConstrainedModule,
|
||||
) {
|
||||
|
|
|
@ -25,9 +25,9 @@ use crate::{
|
|||
/**
|
||||
Insert the reference count operations for procedures.
|
||||
*/
|
||||
pub fn insert_inc_dec_operations<'a, 'i>(
|
||||
pub fn insert_inc_dec_operations<'a>(
|
||||
arena: &'a Bump,
|
||||
layout_interner: &'i STLayoutInterner<'a>,
|
||||
layout_interner: &STLayoutInterner<'a>,
|
||||
procedures: &mut HashMap<(Symbol, ProcLayout), Proc<'a>, BuildHasherDefault<WyHash>>,
|
||||
) {
|
||||
// Create a SymbolRcTypesEnv for the procedures as they get referenced but should be marked as non reference counted.
|
||||
|
@ -401,9 +401,9 @@ impl<'v> RefcountEnvironment<'v> {
|
|||
/**
|
||||
Insert the reference counting operations into a statement.
|
||||
*/
|
||||
fn insert_inc_dec_operations_proc<'a, 'i>(
|
||||
fn insert_inc_dec_operations_proc<'a>(
|
||||
arena: &'a Bump,
|
||||
mut symbol_rc_types_env: SymbolRcTypesEnv<'a, 'i>,
|
||||
mut symbol_rc_types_env: SymbolRcTypesEnv<'a, '_>,
|
||||
proc: &mut Proc<'a>,
|
||||
) {
|
||||
// Clone the symbol_rc_types_env and insert the symbols in the current procedure.
|
||||
|
|
|
@ -280,7 +280,9 @@ impl AbilityAliases {
|
|||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
#[derive(Default)]
|
||||
pub enum CapturedSymbols<'a> {
|
||||
#[default]
|
||||
None,
|
||||
Captured(&'a [(Symbol, Variable)]),
|
||||
}
|
||||
|
@ -294,11 +296,7 @@ impl<'a> CapturedSymbols<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Default for CapturedSymbols<'a> {
|
||||
fn default() -> Self {
|
||||
CapturedSymbols::None
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct Proc<'a> {
|
||||
|
@ -2722,8 +2720,8 @@ fn patterns_to_when<'a>(
|
|||
/// { x } -> body
|
||||
///
|
||||
/// conversion of one-pattern when expressions will do the most optimal thing
|
||||
fn pattern_to_when<'a>(
|
||||
env: &mut Env<'a, '_>,
|
||||
fn pattern_to_when(
|
||||
env: &mut Env<'_, '_>,
|
||||
pattern_var: Variable,
|
||||
pattern: Loc<roc_can::pattern::Pattern>,
|
||||
body_var: Variable,
|
||||
|
@ -5740,8 +5738,8 @@ fn compile_struct_like<'a, L, UnusedLayout>(
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn late_resolve_ability_specialization<'a>(
|
||||
env: &mut Env<'a, '_>,
|
||||
fn late_resolve_ability_specialization(
|
||||
env: &mut Env<'_, '_>,
|
||||
member: Symbol,
|
||||
specialization_id: Option<SpecializationId>,
|
||||
specialization_var: Variable,
|
||||
|
|
|
@ -1193,7 +1193,7 @@ fn extract<'a>(
|
|||
|
||||
/// FIND IRRELEVANT BRANCHES
|
||||
|
||||
fn is_irrelevant_to<'a>(selected_path: &[PathInstruction], branch: &Branch<'a>) -> bool {
|
||||
fn is_irrelevant_to(selected_path: &[PathInstruction], branch: &Branch<'_>) -> bool {
|
||||
match branch
|
||||
.patterns
|
||||
.iter()
|
||||
|
@ -1720,7 +1720,7 @@ fn test_to_comparison<'a>(
|
|||
|
||||
Test::IsFloat(test_int, precision) => {
|
||||
// TODO maybe we can actually use i64 comparison here?
|
||||
let test_float = f64::from_bits(test_int as u64);
|
||||
let test_float = f64::from_bits(test_int);
|
||||
let lhs = Expr::Literal(Literal::Float(test_float));
|
||||
let lhs_symbol = env.unique_symbol();
|
||||
stores.push((lhs_symbol, Layout::float_width(precision), lhs));
|
||||
|
@ -2240,7 +2240,7 @@ fn decide_to_branching<'a>(
|
|||
|
||||
let tag = match test {
|
||||
Test::IsInt(v, _) => i128::from_ne_bytes(v) as u64,
|
||||
Test::IsFloat(v, _) => v as u64,
|
||||
Test::IsFloat(v, _) => v,
|
||||
Test::IsBit(v) => v as u64,
|
||||
Test::IsByte { tag_id, .. } => tag_id as u64,
|
||||
Test::IsCtor { tag_id, .. } => tag_id as u64,
|
||||
|
|
|
@ -457,7 +457,7 @@ macro_rules! cached {
|
|||
}
|
||||
|
||||
pub type TagIdIntType = u16;
|
||||
pub const MAX_ENUM_SIZE: usize = (std::mem::size_of::<TagIdIntType>() * 8) as usize;
|
||||
pub const MAX_ENUM_SIZE: usize = std::mem::size_of::<TagIdIntType>() * 8;
|
||||
const GENERATE_NULLABLE: bool = true;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
@ -898,7 +898,7 @@ impl<'a> UnionLayout<'a> {
|
|||
} => {
|
||||
debug_assert_ne!(nullable_id, tag_id != 0);
|
||||
|
||||
other_fields[index as usize]
|
||||
other_fields[index]
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ macro_rules! cache_interned_layouts {
|
|||
)*
|
||||
}
|
||||
|
||||
fn fill_reserved_layouts<'a>(interner: &mut STLayoutInterner<'a>) {
|
||||
fn fill_reserved_layouts(interner: &mut STLayoutInterner<'_>) {
|
||||
assert!(interner.is_empty());
|
||||
$(
|
||||
interner.insert($layout);
|
||||
|
|
|
@ -1128,8 +1128,8 @@ impl<'a> ReuseEnvironment<'a> {
|
|||
/**
|
||||
Check if a layout can be reused. by verifying if the layout is a union and if the tag is not nullable.
|
||||
*/
|
||||
fn can_reuse_layout<'a, 'i>(
|
||||
layout_interner: &'i STLayoutInterner<'a>,
|
||||
fn can_reuse_layout<'a>(
|
||||
layout_interner: &STLayoutInterner<'a>,
|
||||
environment: &ReuseEnvironment<'a>,
|
||||
layout: &InLayout<'a>,
|
||||
) -> Reuse {
|
||||
|
|
|
@ -105,14 +105,14 @@ impl Position {
|
|||
#[must_use]
|
||||
pub const fn bump_column(self, count: u32) -> Self {
|
||||
Self {
|
||||
offset: self.offset + count as u32,
|
||||
offset: self.offset + count,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn bump_invisible(self, count: u32) -> Self {
|
||||
Self {
|
||||
offset: self.offset + count as u32,
|
||||
offset: self.offset + count,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ impl Position {
|
|||
#[must_use]
|
||||
pub const fn sub(self, count: u32) -> Self {
|
||||
Self {
|
||||
offset: self.offset - count as u32,
|
||||
offset: self.offset - count,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -376,7 +376,7 @@ impl LineInfo {
|
|||
let column = offset - self.line_offsets[line];
|
||||
LineColumn {
|
||||
line: line as u32,
|
||||
column: column as u32,
|
||||
column,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2537,14 +2537,14 @@ enum TypeToVar {
|
|||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn type_to_variable<'a>(
|
||||
fn type_to_variable(
|
||||
subs: &mut Subs,
|
||||
rank: Rank,
|
||||
pools: &mut Pools,
|
||||
problems: &mut Vec<TypeError>,
|
||||
abilities_store: &AbilitiesStore,
|
||||
obligation_cache: &mut ObligationCache,
|
||||
arena: &'a bumpalo::Bump,
|
||||
arena: &bumpalo::Bump,
|
||||
aliases: &mut Aliases,
|
||||
types: &mut Types,
|
||||
typ: Index<TypeTag>,
|
||||
|
|
|
@ -183,7 +183,7 @@ fn parse_queries(src: &str, line_info: &LineInfo) -> Vec<TypeQuery> {
|
|||
}
|
||||
};
|
||||
|
||||
let mut queries_on_line = RE_TYPE_QUERY.captures_iter(line).into_iter().peekable();
|
||||
let mut queries_on_line = RE_TYPE_QUERY.captures_iter(line).peekable();
|
||||
|
||||
if queries_on_line.peek().is_none() || line.contains(MUTLILINE_MARKER) {
|
||||
consecutive_query_lines = 0;
|
||||
|
|
|
@ -1285,8 +1285,8 @@ fn write_flat_type<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
pub fn push_union<'a, L: Label>(
|
||||
subs: &'a Subs,
|
||||
pub fn push_union<L: Label>(
|
||||
subs: &Subs,
|
||||
tags: &UnionLabels<L>,
|
||||
fields: &mut Vec<(L, Vec<Variable>)>,
|
||||
) {
|
||||
|
|
|
@ -1360,8 +1360,8 @@ fn separate_union_lambdas<M: MetaCollector>(
|
|||
let mut buckets: VecMap<Symbol, Sides> = VecMap::with_capacity(fields1.len() + fields2.len());
|
||||
|
||||
let (mut fields_left, mut fields_right) = (
|
||||
fields1.iter_all().into_iter().peekable(),
|
||||
fields2.iter_all().into_iter().peekable(),
|
||||
fields1.iter_all().peekable(),
|
||||
fields2.iter_all().peekable(),
|
||||
);
|
||||
|
||||
loop {
|
||||
|
|
|
@ -67,8 +67,8 @@ impl RenderedWgpu {
|
|||
}
|
||||
|
||||
// create text and rectangles based on EdModel's markup_root
|
||||
pub fn model_to_wgpu<'a>(
|
||||
ed_model: &'a mut EdModel,
|
||||
pub fn model_to_wgpu(
|
||||
ed_model: &mut EdModel,
|
||||
size: &PhysicalSize<u32>,
|
||||
txt_coords: Vector2<f32>,
|
||||
config: &Config,
|
||||
|
|
|
@ -16,13 +16,13 @@ use winit::dpi::PhysicalSize;
|
|||
|
||||
use crate::{editor::config::Config, graphics::colors};
|
||||
|
||||
pub fn build_code_graphics<'a>(
|
||||
pub fn build_code_graphics(
|
||||
markup_ids: &[MarkNodeId],
|
||||
size: &PhysicalSize<u32>,
|
||||
txt_coords: Vector2<f32>,
|
||||
config: &Config,
|
||||
glyph_dim_rect: Rect,
|
||||
mark_node_pool: &'a SlowPool,
|
||||
mark_node_pool: &SlowPool,
|
||||
) -> EdResult<RenderedWgpu> {
|
||||
let area_bounds = (size.width as f32, size.height as f32);
|
||||
let layout = wgpu_glyph::Layout::default().h_align(wgpu_glyph::HorizontalAlign::Left);
|
||||
|
|
|
@ -200,7 +200,6 @@ pub mod test_caret_w_select {
|
|||
.as_span()
|
||||
.as_str()
|
||||
.split('\n')
|
||||
.into_iter()
|
||||
.collect::<Vec<&str>>();
|
||||
|
||||
if split_str.len() > 1 {
|
||||
|
|
|
@ -68,7 +68,7 @@ fn collect_roc_definitions<'a>(object: &object::File<'a, &'a [u8]>) -> MutMap<St
|
|||
.next()
|
||||
.unwrap();
|
||||
|
||||
let address = sym.address() as u64;
|
||||
let address = sym.address();
|
||||
|
||||
// special exceptions for roc_ functions that map to libc symbols
|
||||
let direct_mapping = match name {
|
||||
|
@ -972,7 +972,7 @@ fn scan_elf_dynamic_deps(
|
|||
|
||||
dyn_lib_index += 1;
|
||||
}
|
||||
let dynamic_lib_count = dyn_lib_index as usize;
|
||||
let dynamic_lib_count = dyn_lib_index;
|
||||
|
||||
if shared_lib_index.is_none() {
|
||||
panic!("Shared lib not found as a dependency of the executable");
|
||||
|
@ -1374,8 +1374,8 @@ fn surgery_elf_help(
|
|||
};
|
||||
|
||||
if let Some(target_offset) = target_offset {
|
||||
let virt_base = section_virtual_offset as usize + rel.0 as usize;
|
||||
let base = section_offset as usize + rel.0 as usize;
|
||||
let virt_base = section_virtual_offset + rel.0 as usize;
|
||||
let base = section_offset + rel.0 as usize;
|
||||
let target: i64 = match rel.1.kind() {
|
||||
RelocationKind::Relative | RelocationKind::PltRelative => {
|
||||
target_offset - virt_base as i64 + rel.1.addend()
|
||||
|
@ -1449,14 +1449,14 @@ fn surgery_elf_help(
|
|||
offset += new_section_count * sh_ent_size as usize;
|
||||
let section_headers = load_structs_inplace_mut::<elf::SectionHeader64<LE>>(
|
||||
exec_mmap,
|
||||
new_sh_offset as usize,
|
||||
new_sh_offset,
|
||||
sh_num as usize + new_section_count,
|
||||
);
|
||||
|
||||
let new_rodata_section_size = new_text_section_offset as u64 - new_rodata_section_offset as u64;
|
||||
let new_rodata_section_virtual_size =
|
||||
new_text_section_vaddr as u64 - new_rodata_section_vaddr as u64;
|
||||
let new_text_section_vaddr = new_rodata_section_vaddr as u64 + new_rodata_section_size as u64;
|
||||
let new_text_section_vaddr = new_rodata_section_vaddr as u64 + new_rodata_section_size;
|
||||
let new_text_section_size = new_sh_offset as u64 - new_text_section_offset as u64;
|
||||
|
||||
// set the new rodata section header
|
||||
|
@ -1610,7 +1610,7 @@ fn surgery_elf_help(
|
|||
dynsym_offset as usize + *i as usize * mem::size_of::<elf::Sym64<LE>>(),
|
||||
);
|
||||
sym.st_shndx = endian::U16::new(LE, new_text_section_index as u16);
|
||||
sym.st_value = endian::U64::new(LE, func_virt_offset as u64);
|
||||
sym.st_value = endian::U64::new(LE, func_virt_offset);
|
||||
sym.st_size = endian::U64::new(
|
||||
LE,
|
||||
match app_func_size_map.get(func_name) {
|
||||
|
@ -1627,7 +1627,7 @@ fn surgery_elf_help(
|
|||
symtab_offset as usize + *i as usize * mem::size_of::<elf::Sym64<LE>>(),
|
||||
);
|
||||
sym.st_shndx = endian::U16::new(LE, new_text_section_index as u16);
|
||||
sym.st_value = endian::U64::new(LE, func_virt_offset as u64);
|
||||
sym.st_value = endian::U64::new(LE, func_virt_offset);
|
||||
sym.st_size = endian::U64::new(
|
||||
LE,
|
||||
match app_func_size_map.get(func_name) {
|
||||
|
@ -1812,7 +1812,7 @@ mod tests {
|
|||
false,
|
||||
);
|
||||
|
||||
std::fs::copy(&preprocessed_host_filename, &dir.join("final")).unwrap();
|
||||
std::fs::copy(&preprocessed_host_filename, dir.join("final")).unwrap();
|
||||
|
||||
surgery_elf(
|
||||
&roc_app,
|
||||
|
@ -1833,7 +1833,7 @@ mod tests {
|
|||
|
||||
zig_host_app_help(dir, &Triple::from_str("x86_64-unknown-linux-musl").unwrap());
|
||||
|
||||
let output = std::process::Command::new(&dir.join("final"))
|
||||
let output = std::process::Command::new(dir.join("final"))
|
||||
.current_dir(dir)
|
||||
.output()
|
||||
.unwrap();
|
||||
|
|
|
@ -255,7 +255,7 @@ fn generate_dynamic_lib(target: &Triple, stub_dll_symbols: &[String], stub_lib_p
|
|||
let bytes = crate::generate_dylib::generate(target, stub_dll_symbols)
|
||||
.unwrap_or_else(|e| internal_error!("{e}"));
|
||||
|
||||
if let Err(e) = std::fs::write(stub_lib_path, &bytes) {
|
||||
if let Err(e) = std::fs::write(stub_lib_path, bytes) {
|
||||
internal_error!("failed to write stub lib to {:?}: {e}", stub_lib_path)
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ fn generate_import_library(stub_lib_path: &Path, custom_names: &[String]) {
|
|||
// For when we want to do this in-memory in the future. We can also consider using
|
||||
//
|
||||
// > https://github.com/messense/implib-rs
|
||||
let output = std::process::Command::new(&zig)
|
||||
let output = std::process::Command::new(zig)
|
||||
.current_dir(stub_lib_path.parent().unwrap())
|
||||
.args([
|
||||
"dlltool",
|
||||
|
|
|
@ -67,7 +67,7 @@ fn collect_roc_definitions<'a>(object: &object::File<'a, &'a [u8]>) -> MutMap<St
|
|||
.next()
|
||||
.unwrap();
|
||||
|
||||
let address = sym.address() as u64;
|
||||
let address = sym.address();
|
||||
|
||||
// special exceptions for memcpy and memset.
|
||||
if name == "roc_memcpy" {
|
||||
|
@ -705,19 +705,19 @@ fn gen_macho_le(
|
|||
// Instead, its file size should be increased.
|
||||
if old_file_offest > 0 {
|
||||
cmd.fileoff
|
||||
.set(LittleEndian, old_file_offest + md.added_byte_count as u64);
|
||||
.set(LittleEndian, old_file_offest + md.added_byte_count);
|
||||
cmd.vmaddr.set(
|
||||
LittleEndian,
|
||||
cmd.vmaddr.get(NativeEndian) + md.added_byte_count as u64,
|
||||
cmd.vmaddr.get(NativeEndian) + md.added_byte_count,
|
||||
);
|
||||
} else {
|
||||
cmd.filesize.set(
|
||||
LittleEndian,
|
||||
cmd.filesize.get(NativeEndian) + md.added_byte_count as u64,
|
||||
cmd.filesize.get(NativeEndian) + md.added_byte_count,
|
||||
);
|
||||
cmd.vmsize.set(
|
||||
LittleEndian,
|
||||
cmd.vmsize.get(NativeEndian) + md.added_byte_count as u64,
|
||||
cmd.vmsize.get(NativeEndian) + md.added_byte_count,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -831,7 +831,7 @@ fn gen_macho_le(
|
|||
if entry_type == macho::N_ABS || entry_type == macho::N_SECT {
|
||||
entry.n_value.set(
|
||||
LittleEndian,
|
||||
entry.n_value.get(NativeEndian) + md.added_byte_count as u64,
|
||||
entry.n_value.get(NativeEndian) + md.added_byte_count,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1046,7 +1046,7 @@ fn gen_macho_le(
|
|||
|
||||
cmd.entryoff.set(
|
||||
LittleEndian,
|
||||
cmd.entryoff.get(NativeEndian) + md.added_byte_count as u64,
|
||||
cmd.entryoff.get(NativeEndian) + md.added_byte_count,
|
||||
);
|
||||
}
|
||||
macho::LC_NOTE => {
|
||||
|
@ -1058,7 +1058,7 @@ fn gen_macho_le(
|
|||
if cmd.size.get(NativeEndian) > 0 {
|
||||
cmd.offset.set(
|
||||
LittleEndian,
|
||||
cmd.offset.get(NativeEndian) + md.added_byte_count as u64,
|
||||
cmd.offset.get(NativeEndian) + md.added_byte_count,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1397,8 +1397,8 @@ fn surgery_macho_help(
|
|||
};
|
||||
|
||||
if let Some(target_offset) = target_offset {
|
||||
let virt_base = section_virtual_offset as usize + rel.0 as usize;
|
||||
let base = section_offset as usize + rel.0 as usize;
|
||||
let virt_base = section_virtual_offset + rel.0 as usize;
|
||||
let base = section_offset + rel.0 as usize;
|
||||
let target: i64 = match rel.1.kind() {
|
||||
RelocationKind::Relative | RelocationKind::PltRelative => {
|
||||
target_offset - virt_base as i64 + rel.1.addend()
|
||||
|
|
|
@ -307,7 +307,7 @@ pub(crate) fn surgery_pe(executable_path: &Path, metadata_path: &Path, roc_app_b
|
|||
let app_code_section_va = md.last_host_section_address
|
||||
+ next_multiple_of(
|
||||
md.last_host_section_size as usize,
|
||||
section_alignment as usize,
|
||||
section_alignment,
|
||||
) as u64;
|
||||
|
||||
let mut section_file_offset = md.dynhost_file_size;
|
||||
|
@ -470,9 +470,9 @@ pub(crate) fn surgery_pe(executable_path: &Path, metadata_path: &Path, roc_app_b
|
|||
update_optional_header(
|
||||
executable,
|
||||
md.optional_header_offset,
|
||||
code_bytes_added as u32,
|
||||
file_bytes_added as u32,
|
||||
data_bytes_added as u32,
|
||||
code_bytes_added,
|
||||
file_bytes_added,
|
||||
data_bytes_added,
|
||||
);
|
||||
|
||||
let symbols: Vec<_> = symbols
|
||||
|
@ -707,7 +707,7 @@ impl Preprocessor {
|
|||
|
||||
Self {
|
||||
extra_sections_start: section_table_offset as usize
|
||||
+ sections.len() as usize * Self::SECTION_HEADER_WIDTH,
|
||||
+ sections.len() * Self::SECTION_HEADER_WIDTH,
|
||||
extra_sections_width,
|
||||
additional_header_space,
|
||||
additional_reloc_space,
|
||||
|
@ -1724,7 +1724,7 @@ mod test {
|
|||
)
|
||||
.unwrap();
|
||||
|
||||
std::fs::copy(&preprocessed_host_filename, &dir.join("app.exe")).unwrap();
|
||||
std::fs::copy(&preprocessed_host_filename, dir.join("app.exe")).unwrap();
|
||||
|
||||
surgery_pe(&dir.join("app.exe"), &dir.join("metadata"), &roc_app);
|
||||
}
|
||||
|
@ -1739,7 +1739,7 @@ mod test {
|
|||
|
||||
runner(dir);
|
||||
|
||||
let output = std::process::Command::new(&dir.join("app.exe"))
|
||||
let output = std::process::Command::new(dir.join("app.exe"))
|
||||
.current_dir(dir)
|
||||
.output()
|
||||
.unwrap();
|
||||
|
@ -1908,7 +1908,7 @@ mod test {
|
|||
|
||||
std::fs::write(dir.join("host.zig"), host_zig.as_bytes()).unwrap();
|
||||
|
||||
let mut command = std::process::Command::new(&zig);
|
||||
let mut command = std::process::Command::new(zig);
|
||||
command.current_dir(dir).args([
|
||||
"build-exe",
|
||||
"host.zig",
|
||||
|
|
|
@ -596,7 +596,7 @@ fn format_output(
|
|||
|
||||
let term_width = match dimensions {
|
||||
Some((width, _)) => width.min(VAR_NAME_COLUMN_MAX),
|
||||
None => VAR_NAME_COLUMN_MAX as usize,
|
||||
None => VAR_NAME_COLUMN_MAX,
|
||||
};
|
||||
|
||||
let expr_with_type = format!("{expr}{EXPR_TYPE_SEPARATOR}{expr_type}");
|
||||
|
|
|
@ -265,8 +265,8 @@ fn get_tags_vars_and_variant<'a>(
|
|||
(vars_of_tag, union_variant)
|
||||
}
|
||||
|
||||
fn expr_of_tag<'a, 'env, M: ReplAppMemory>(
|
||||
env: &mut Env<'a, 'env>,
|
||||
fn expr_of_tag<'a, M: ReplAppMemory>(
|
||||
env: &mut Env<'a, '_>,
|
||||
mem: &'a M,
|
||||
data_addr: usize,
|
||||
tag_name: &TagName,
|
||||
|
@ -289,8 +289,8 @@ fn expr_of_tag<'a, 'env, M: ReplAppMemory>(
|
|||
|
||||
/// Gets the tag ID of a union variant, assuming that the tag ID is stored alongside (after) the
|
||||
/// tag data. The caller is expected to check that the tag ID is indeed stored this way.
|
||||
fn tag_id_from_data<'a, 'env, M: ReplAppMemory>(
|
||||
env: &Env<'a, 'env>,
|
||||
fn tag_id_from_data<'a, M: ReplAppMemory>(
|
||||
env: &Env<'a, '_>,
|
||||
mem: &M,
|
||||
union_layout: UnionLayout<'a>,
|
||||
data_addr: usize,
|
||||
|
@ -947,8 +947,8 @@ fn list_to_ast<'a, M: ReplAppMemory>(
|
|||
Expr::List(Collection::with_items(output))
|
||||
}
|
||||
|
||||
fn single_tag_union_to_ast<'a, 'env, M: ReplAppMemory>(
|
||||
env: &mut Env<'a, 'env>,
|
||||
fn single_tag_union_to_ast<'a, M: ReplAppMemory>(
|
||||
env: &mut Env<'a, '_>,
|
||||
mem: &'a M,
|
||||
addr: usize,
|
||||
field_layouts: &'a [InLayout<'a>],
|
||||
|
@ -1004,8 +1004,8 @@ where
|
|||
output
|
||||
}
|
||||
|
||||
fn struct_to_ast<'a, 'env, M: ReplAppMemory>(
|
||||
env: &mut Env<'a, 'env>,
|
||||
fn struct_to_ast<'a, M: ReplAppMemory>(
|
||||
env: &mut Env<'a, '_>,
|
||||
mem: &'a M,
|
||||
addr: usize,
|
||||
record_fields: RecordFields,
|
||||
|
@ -1130,8 +1130,8 @@ fn struct_to_ast<'a, 'env, M: ReplAppMemory>(
|
|||
}
|
||||
}
|
||||
|
||||
fn struct_to_ast_tuple<'a, 'env, M: ReplAppMemory>(
|
||||
env: &mut Env<'a, 'env>,
|
||||
fn struct_to_ast_tuple<'a, M: ReplAppMemory>(
|
||||
env: &mut Env<'a, '_>,
|
||||
mem: &'a M,
|
||||
addr: usize,
|
||||
tuple_elems: TupleElems,
|
||||
|
|
|
@ -31,7 +31,7 @@ fn main() {
|
|||
let builtins_host_tempfile = roc_bitcode::host_wasm_tempfile()
|
||||
.expect("failed to write host builtins object to tempfile");
|
||||
|
||||
let output = Command::new(&zig_executable())
|
||||
let output = Command::new(zig_executable())
|
||||
.args([
|
||||
"wasm-ld",
|
||||
builtins_host_tempfile.path().to_str().unwrap(),
|
||||
|
@ -67,7 +67,7 @@ fn build_wasm_platform(out_dir: &str, source_path: &str) -> PathBuf {
|
|||
let mut platform_obj = PathBuf::from(out_dir).join(PLATFORM_FILENAME);
|
||||
platform_obj.set_extension(OBJECT_EXTENSION);
|
||||
|
||||
Command::new(&zig_executable())
|
||||
Command::new(zig_executable())
|
||||
.args([
|
||||
"build-lib",
|
||||
"-target",
|
||||
|
|
|
@ -15,7 +15,7 @@ macro_rules! bytes_id {
|
|||
$owned_vis struct $owned($owned_vis ::smallvec::SmallVec<[u8; 23]>);
|
||||
|
||||
impl $owned {
|
||||
fn borrowed<'a>(&'a self) -> $borrowed<'a> {
|
||||
fn borrowed(&self) -> $borrowed<'_> {
|
||||
$borrowed(&self.0)
|
||||
}
|
||||
}
|
||||
|
|
4
crates/vendor/pathfinding/src/lib.rs
vendored
4
crates/vendor/pathfinding/src/lib.rs
vendored
|
@ -219,7 +219,7 @@ where
|
|||
})
|
||||
.collect();
|
||||
if prev_group.is_empty() {
|
||||
let remaining: Vec<N> = preds_map.into_iter().map(|(node, _)| node).collect();
|
||||
let remaining: Vec<N> = preds_map.into_keys().collect();
|
||||
return Err((Vec::new(), remaining));
|
||||
}
|
||||
for node in &prev_group {
|
||||
|
@ -241,7 +241,7 @@ where
|
|||
}
|
||||
groups.push(mem::replace(&mut prev_group, next_group));
|
||||
if prev_group.is_empty() {
|
||||
let remaining: Vec<N> = preds_map.into_iter().map(|(node, _)| node).collect();
|
||||
let remaining: Vec<N> = preds_map.into_keys().collect();
|
||||
return Err((groups, remaining));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ fn main() {
|
|||
.unwrap();
|
||||
|
||||
// Copy libc to where Cargo expects the output of this crate
|
||||
fs::copy(&libc_path, &out_file).unwrap();
|
||||
fs::copy(libc_path, &out_file).unwrap();
|
||||
|
||||
println!(
|
||||
"cargo:rustc-env=WASI_LIBC_PATH={}",
|
||||
|
|
|
@ -948,7 +948,7 @@ impl<'a, I: ImportDispatcher> Instance<'a, I> {
|
|||
let memory_index = self.fetch_immediate_u32(module);
|
||||
assert_eq!(memory_index, 0);
|
||||
let old_bytes = self.memory.len() as u32;
|
||||
let old_pages = old_bytes / MemorySection::PAGE_SIZE as u32;
|
||||
let old_pages = old_bytes / MemorySection::PAGE_SIZE;
|
||||
let grow_pages = self.value_store.pop_u32()?;
|
||||
let grow_bytes = grow_pages * MemorySection::PAGE_SIZE;
|
||||
let new_bytes = old_bytes + grow_bytes;
|
||||
|
@ -1700,7 +1700,7 @@ impl<'a, I: ImportDispatcher> Instance<'a, I> {
|
|||
} else {
|
||||
// For calls, we print special debug stuff in do_call
|
||||
let base = self.current_frame.locals_start + self.current_frame.locals_count;
|
||||
let slice = self.value_store.get_slice(base as usize);
|
||||
let slice = self.value_store.get_slice(base);
|
||||
eprintln!("{:06x} {:17} {:x?}", file_offset, debug_string, slice);
|
||||
}
|
||||
let is_return = op_code == RETURN || (op_code == END && implicit_return);
|
||||
|
|
|
@ -37,7 +37,7 @@ fn test_loop_help(end: i32, expected: i32) {
|
|||
|
||||
// loop <void>
|
||||
buf.push(OpCode::LOOP as u8);
|
||||
buf.push(ValueType::VOID as u8);
|
||||
buf.push(ValueType::VOID);
|
||||
|
||||
// local.get $i
|
||||
buf.push(OpCode::GETLOCAL as u8);
|
||||
|
@ -135,7 +135,7 @@ fn test_if_else_help(condition: i32, expected: i32) {
|
|||
|
||||
// if <blocktype>
|
||||
buf.push(OpCode::IF as u8);
|
||||
buf.push(ValueType::VOID as u8);
|
||||
buf.push(ValueType::VOID);
|
||||
|
||||
// i32.const 111
|
||||
buf.push(OpCode::I32CONST as u8);
|
||||
|
@ -599,7 +599,7 @@ fn test_call_return_no_args() {
|
|||
ValueType::I32 as u8,
|
||||
OpCode::BLOCK as u8, /* */
|
||||
// call from inside a block. callee's implicit return should still work correctly.
|
||||
ValueType::VOID as u8,
|
||||
ValueType::VOID,
|
||||
OpCode::CALL as u8,
|
||||
1, // function 1
|
||||
OpCode::SETLOCAL as u8,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue