Merge branch 'main' into symbol_tags

Signed-off-by: J Teeuwissen <jelleteeuwissen@hotmail.nl>
This commit is contained in:
J Teeuwissen 2023-04-24 14:19:12 +02:00 committed by GitHub
commit 7710170e68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
190 changed files with 2563 additions and 1933 deletions

18
FAQ.md
View file

@ -188,23 +188,19 @@ would be unable to infer a type—and you'd have to write a type annotation. Thi
situations where the editor would not be able to reliably tell you the type of part of your program, unlike today situations where the editor would not be able to reliably tell you the type of part of your program, unlike today
where it can accurately tell you the type of anything, even if you have no type annotations in your entire code base. where it can accurately tell you the type of anything, even if you have no type annotations in your entire code base.
### Arbitrary-rank types assuming that's right, here is a proposed new FAQ entry:
Unlike arbitrary-rank (aka "Rank-N") types, both Rank-1 and Rank-2 type systems are compatible with principal ### Higher-rank types
type inference. Roc currently uses Rank-1 types, and the benefits of Rank-N over Rank-2 don't seem worth
sacrificing principal type inference to attain, so let's focus on the trade-offs between Rank-1 and Rank-2.
Supporting Rank-2 types in Roc has been discussed before, but it has several important downsides:
Roc uses a Rank-1 type system. Other languages, like Haskell, support Rank-2 or even arbitrary-rank (aka "Rank-N") types. Supporting higher-rank types in Roc has been discussed before, but it has several important downsides:
- It would remove principal decidable type inference. (Only Rank-1 types are compatible with principal decidable type inference; Rank-2 types are decidable but the inferred types are not principal, and Rank 3+ types are not even fully decidable.)
- It would increase the complexity of the language. - It would increase the complexity of the language.
- It would make some compiler error messages more confusing (e.g. they might mention `forall` because that was the most general type that could be inferred, even if that wasn't helpful or related to the actual problem). - It would make some compiler error messages more confusing (e.g. they might mention `forall` because that was the most general type that could be inferred, even if that wasn't helpful or related to the actual problem).
- It would substantially increase the complexity of the type checker, which would necessarily slow it down. - It would substantially increase the complexity of the type checker, which would necessarily slow it down.
- Most significantly, it would make the runtime slower, because Roc compiles programs by fully specializing all function calls to their type instances (this is sometimes called monomorphization). It's unclear how we could fully specialize programs containing Rank-2 types, which means compiling programs that included Rank-2 types (or higher) would require losing specialization in general—which would substantially degrade runtime performance.
No implementation of Rank-2 types can remove any of these downsides. Thus far, we've been able to come up As such, the plan is for Roc to stick with Rank-1 types indefinitely.
with sufficiently nice APIs that only require Rank-1 types, and we haven't seen a really compelling use case
where the gap between the Rank-2 and Rank-1 designs was big enough to justify switching to Rank-2.
As such, the plan is for Roc to stick with Rank-1 types indefinitely. In Roc's case, the benefits of Rank-1's faster compilation with nicer error messages and a simpler type system outweigh Rank-2's benefits of expanded API options.
### Higher-kinded polymorphism ### Higher-kinded polymorphism

View file

@ -1959,8 +1959,8 @@ pub mod test_constrain {
}; };
use indoc::indoc; use indoc::indoc;
fn run_solve<'a>( fn run_solve(
arena: &'a Bump, arena: &Bump,
mempool: &mut Pool, mempool: &mut Pool,
aliases: MutMap<Symbol, roc_types::types::Alias>, aliases: MutMap<Symbol, roc_types::types::Alias>,
rigid_variables: MutMap<Variable, Lowercase>, rigid_variables: MutMap<Variable, Lowercase>,

View file

@ -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 { unsafe {
let node_ptr = self.get_ptr(node_id) as *const T; let node_ptr = self.get_ptr(node_id) as *const T;

View file

@ -100,11 +100,11 @@ pub fn format(files: std::vec::Vec<PathBuf>, mode: FormatMode) -> Result<(), Str
let mut before_file = file.clone(); let mut before_file = file.clone();
before_file.set_extension("roc-format-failed-ast-before"); 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(); let mut after_file = file.clone();
after_file.set_extension("roc-format-failed-ast-after"); 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!( internal_error!(
"Formatting bug; formatting didn't reparse as the same tree\n\n\ "Formatting bug; formatting didn't reparse as the same tree\n\n\

View file

@ -1234,9 +1234,10 @@ fn run_wasm<I: Iterator<Item = S>, S: AsRef<[u8]>>(_wasm_path: &std::path::Path,
println!("Running wasm files is not supported on this target."); println!("Running wasm files is not supported on this target.");
} }
#[derive(Debug, Copy, Clone, EnumIter, IntoStaticStr, PartialEq, Eq)] #[derive(Debug, Copy, Clone, EnumIter, IntoStaticStr, PartialEq, Eq, Default)]
pub enum Target { pub enum Target {
#[strum(serialize = "system")] #[strum(serialize = "system")]
#[default]
System, System,
#[strum(serialize = "linux32")] #[strum(serialize = "linux32")]
Linux32, Linux32,
@ -1248,12 +1249,6 @@ pub enum Target {
Wasm32, Wasm32,
} }
impl Default for Target {
fn default() -> Self {
Target::System
}
}
impl Target { impl Target {
pub fn to_triple(self) -> Triple { pub fn to_triple(self) -> Triple {
use Target::*; use Target::*;

View file

@ -13,8 +13,8 @@ use crate::{
slow_pool::{MarkNodeId, SlowPool}, slow_pool::{MarkNodeId, SlowPool},
}; };
pub fn ast_to_mark_nodes<'a>( pub fn ast_to_mark_nodes(
env: &mut Env<'a>, env: &mut Env<'_>,
ast: &AST, ast: &AST,
mark_node_pool: &mut SlowPool, mark_node_pool: &mut SlowPool,
interns: &Interns, interns: &Interns,

View file

@ -35,8 +35,8 @@ pub fn add_node(
mark_node_id mark_node_id
} }
pub fn def2_to_markup<'a>( pub fn def2_to_markup(
env: &mut Env<'a>, env: &mut Env<'_>,
def2: &Def2, def2: &Def2,
def2_node_id: DefId, def2_node_id: DefId,
mark_node_pool: &mut SlowPool, mark_node_pool: &mut SlowPool,

View file

@ -35,8 +35,8 @@ use roc_module::{module_err::ModuleResult, symbol::Interns};
use super::from_def2::add_node; use super::from_def2::add_node;
// make Markup Nodes: generate String representation, assign Highlighting Style // make Markup Nodes: generate String representation, assign Highlighting Style
pub fn expr2_to_markup<'a>( pub fn expr2_to_markup(
env: &Env<'a>, env: &Env<'_>,
expr2: &Expr2, expr2: &Expr2,
expr2_node_id: ExprId, expr2_node_id: ExprId,
mark_node_pool: &mut SlowPool, mark_node_pool: &mut SlowPool,

View file

@ -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() pool_str.as_str(env.pool).to_owned()
} }

View file

@ -19,13 +19,13 @@ use super::{
}; };
// represents for example: `main = "Hello, World!"` // represents for example: `main = "Hello, World!"`
pub fn assignment_mark_node<'a>( pub fn assignment_mark_node(
identifier_id: IdentId, identifier_id: IdentId,
expr_mark_node_id: MarkNodeId, expr_mark_node_id: MarkNodeId,
ast_node_id: ASTNodeId, ast_node_id: ASTNodeId,
mark_node_pool: &mut SlowPool, mark_node_pool: &mut SlowPool,
mark_id_ast_id_map: &mut MarkIdAstIdMap, mark_id_ast_id_map: &mut MarkIdAstIdMap,
env: &Env<'a>, env: &Env<'_>,
) -> ASTResult<MarkupNode> { ) -> ASTResult<MarkupNode> {
let val_name = env.ident_ids.get_name_str_res(identifier_id)?; let val_name = env.ident_ids.get_name_str_res(identifier_id)?;

View file

@ -487,9 +487,9 @@ impl<'a> Env<'a> {
} }
} }
fn apply_refcount_operation<'a>( fn apply_refcount_operation(
builder: &mut FuncDefBuilder, builder: &mut FuncDefBuilder,
env: &mut Env<'a>, env: &mut Env<'_>,
block: BlockId, block: BlockId,
modify_rc: &ModifyRc, modify_rc: &ModifyRc,
) -> Result<()> { ) -> Result<()> {

View file

@ -719,7 +719,7 @@ pub fn rebuild_host(
if matches!(opt_level, OptLevel::Optimize) { if matches!(opt_level, OptLevel::Optimize) {
rustc_cmd.arg("-O"); rustc_cmd.arg("-O");
} else if matches!(opt_level, OptLevel::Size) { } else if matches!(opt_level, OptLevel::Size) {
rustc_cmd.arg("-C opt-level=s"); rustc_cmd.args(["-C", "opt-level=s"]);
} }
run_build_command(rustc_cmd, "host.rs", 0); run_build_command(rustc_cmd, "host.rs", 0);
@ -1100,7 +1100,7 @@ fn link_linux(
// Keep NIX_ env vars // Keep NIX_ env vars
.envs( .envs(
env::vars() env::vars()
.filter(|&(ref k, _)| k.starts_with("NIX_")) .filter(|(k, _)| k.starts_with("NIX_"))
.collect::<HashMap<String, String>>(), .collect::<HashMap<String, String>>(),
) )
.args([ .args([

View file

@ -34,6 +34,7 @@ interface Num
Binary32, Binary32,
Binary64, Binary64,
abs, abs,
absDiff,
neg, neg,
add, add,
sub, sub,
@ -643,6 +644,27 @@ toFrac : Num * -> Frac *
## Calling this on an unsigned integer (like [U32] or [U64]) never does anything. ## Calling this on an unsigned integer (like [U32] or [U64]) never does anything.
abs : Num a -> Num a abs : Num a -> Num a
## Return the absolute difference between two numbers.
##
## ```
## Num.absDiff 5 3
##
## Num.absDiff -3 5
##
## Num.absDiff 3.0 5.0
## ```
##
## If the answer to this operation can't fit in the return value (e.g. an
## [I8] answer that's higher than 127 or lower than -128), the result is an
## *overflow*. For [F64] and [F32], overflow results in an answer of either
## ∞ or -∞. For all other number types, overflow results in a panic.
absDiff : Num a, Num a -> Num a
absDiff = \a, b ->
if a > b then
a - b
else
b - a
## Return a negative number when given a positive one, and vice versa. ## Return a negative number when given a positive one, and vice versa.
## ``` ## ```
## Num.neg 5 ## Num.neg 5

View file

@ -1134,7 +1134,7 @@ fn canonicalize_has_clause(
} }
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
fn can_extension_type<'a>( fn can_extension_type(
env: &mut Env, env: &mut Env,
pol: CanPolarity, pol: CanPolarity,
scope: &mut Scope, scope: &mut Scope,
@ -1142,7 +1142,7 @@ fn can_extension_type<'a>(
introduced_variables: &mut IntroducedVariables, introduced_variables: &mut IntroducedVariables,
local_aliases: &mut VecMap<Symbol, Alias>, local_aliases: &mut VecMap<Symbol, Alias>,
references: &mut VecSet<Symbol>, references: &mut VecSet<Symbol>,
opt_ext: &Option<&Loc<TypeAnnotation<'a>>>, opt_ext: &Option<&Loc<TypeAnnotation<'_>>>,
ext_problem_kind: roc_problem::can::ExtensionTypeKind, ext_problem_kind: roc_problem::can::ExtensionTypeKind,
) -> (Type, ExtImplicitOpenness) { ) -> (Type, ExtImplicitOpenness) {
fn valid_record_ext_type(typ: &Type) -> bool { fn valid_record_ext_type(typ: &Type) -> bool {
@ -1451,10 +1451,10 @@ fn can_assigned_fields<'a>(
// TODO trim down these arguments! // TODO trim down these arguments!
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
fn can_assigned_tuple_elems<'a>( fn can_assigned_tuple_elems(
env: &mut Env, env: &mut Env,
pol: CanPolarity, pol: CanPolarity,
elems: &&[Loc<TypeAnnotation<'a>>], elems: &&[Loc<TypeAnnotation<'_>>],
scope: &mut Scope, scope: &mut Scope,
var_store: &mut VarStore, var_store: &mut VarStore,
introduced_variables: &mut IntroducedVariables, introduced_variables: &mut IntroducedVariables,

View file

@ -1050,9 +1050,7 @@ fn canonicalize_value_defs<'a>(
let mut symbol_to_index: Vec<(IdentId, u32)> = Vec::with_capacity(pending_value_defs.len()); let mut symbol_to_index: Vec<(IdentId, u32)> = Vec::with_capacity(pending_value_defs.len());
for (def_index, pending_def) in pending_value_defs.iter().enumerate() { for (def_index, pending_def) in pending_value_defs.iter().enumerate() {
let mut new_bindings = BindingsFromPattern::new(pending_def.loc_pattern()) let mut new_bindings = BindingsFromPattern::new(pending_def.loc_pattern()).peekable();
.into_iter()
.peekable();
if new_bindings.peek().is_none() { if new_bindings.peek().is_none() {
env.problem(Problem::NoIdentifiersIntroduced( env.problem(Problem::NoIdentifiersIntroduced(
@ -1339,8 +1337,8 @@ fn canonicalize_type_defs<'a>(
/// Resolve all pending abilities, to add them to scope. /// Resolve all pending abilities, to add them to scope.
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
fn resolve_abilities<'a>( fn resolve_abilities(
env: &mut Env<'a>, env: &mut Env<'_>,
output: &mut Output, output: &mut Output,
var_store: &mut VarStore, var_store: &mut VarStore,
scope: &mut Scope, scope: &mut Scope,
@ -2813,8 +2811,8 @@ fn to_pending_value_def<'a>(
} }
/// Make aliases recursive /// Make aliases recursive
fn correct_mutual_recursive_type_alias<'a>( fn correct_mutual_recursive_type_alias(
env: &mut Env<'a>, env: &mut Env<'_>,
original_aliases: VecMap<Symbol, Alias>, original_aliases: VecMap<Symbol, Alias>,
var_store: &mut VarStore, var_store: &mut VarStore,
) -> VecMap<Symbol, Alias> { ) -> VecMap<Symbol, Alias> {
@ -3022,8 +3020,8 @@ fn correct_mutual_recursive_type_alias<'a>(
unsafe { VecMap::zip(symbols_introduced, aliases) } unsafe { VecMap::zip(symbols_introduced, aliases) }
} }
fn make_tag_union_of_alias_recursive<'a>( fn make_tag_union_of_alias_recursive(
env: &mut Env<'a>, env: &mut Env<'_>,
alias_name: Symbol, alias_name: Symbol,
alias: &mut Alias, alias: &mut Alias,
others: Vec<Symbol>, others: Vec<Symbol>,
@ -3215,8 +3213,8 @@ fn make_tag_union_recursive_help<'a, 'b>(
} }
} }
fn mark_cyclic_alias<'a>( fn mark_cyclic_alias(
env: &mut Env<'a>, env: &mut Env<'_>,
typ: &mut Type, typ: &mut Type,
symbol: Symbol, symbol: Symbol,
alias_kind: AliasKind, alias_kind: AliasKind,

View file

@ -195,11 +195,11 @@ enum GeneratedInfo {
} }
impl GeneratedInfo { impl GeneratedInfo {
fn from_header_type<'a>( fn from_header_type(
env: &mut Env, env: &mut Env,
scope: &mut Scope, scope: &mut Scope,
var_store: &mut VarStore, var_store: &mut VarStore,
header_type: &HeaderType<'a>, header_type: &HeaderType<'_>,
) -> Self { ) -> Self {
match header_type { match header_type {
HeaderType::Hosted { HeaderType::Hosted {

View file

@ -321,8 +321,8 @@ pub fn canonicalize_def_header_pattern<'a>(
#[derive(PartialEq, Eq, Clone, Copy)] #[derive(PartialEq, Eq, Clone, Copy)]
pub struct PermitShadows(pub bool); pub struct PermitShadows(pub bool);
fn canonicalize_pattern_symbol<'a>( fn canonicalize_pattern_symbol(
env: &mut Env<'a>, env: &mut Env<'_>,
scope: &mut Scope, scope: &mut Scope,
output: &mut Output, output: &mut Output,
region: Region, region: Region,

View file

@ -122,7 +122,7 @@ pub fn walk_decls<V: Visitor>(visitor: &mut V, decls: &Declarations) {
None => Pattern::Identifier(loc_symbol.value), 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 { DeclarationInfo::Function {
loc_symbol, loc_symbol,
@ -133,7 +133,7 @@ pub fn walk_decls<V: Visitor>(visitor: &mut V, decls: &Declarations) {
} }
} }
Destructure(destructure_index) => { 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_pattern = &destructure.loc_pattern;
let loc_expr = &decls.expressions[index]; let loc_expr = &decls.expressions[index];

View file

@ -2600,7 +2600,7 @@ pub fn constrain_decls(
cycle_mark, cycle_mark,
); );
index += length as usize; index += length;
} }
} }

View file

@ -55,7 +55,6 @@ pub(crate) fn derive_to_encoder(
// Generalized tuple var so we can reuse this impl between many tuples: // Generalized tuple var so we can reuse this impl between many tuples:
// if arity = n, this is (t1, ..., tn) for fresh t1, ..., tn. // if arity = n, this is (t1, ..., tn) for fresh t1, ..., tn.
let flex_elems = (0..arity) let flex_elems = (0..arity)
.into_iter()
.map(|idx| (idx as usize, env.subs.fresh_unnamed_flex_var())) .map(|idx| (idx as usize, env.subs.fresh_unnamed_flex_var()))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let elems = TupleElems::insert_into_subs(env.subs, flex_elems); let elems = TupleElems::insert_into_subs(env.subs, flex_elems);

View file

@ -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` // TODO: avoid an allocation here by pre-allocating the indices and variables `TupleElems`
// will be instantiated with. // will be instantiated with.
let flex_elems: Vec<_> = (0..arity) let flex_elems: Vec<_> = (0..arity)
.into_iter()
.map(|i| (i as usize, env.subs.fresh_unnamed_flex_var())) .map(|i| (i as usize, env.subs.fresh_unnamed_flex_var()))
.collect(); .collect();
let elems = TupleElems::insert_into_subs(env.subs, flex_elems); let elems = TupleElems::insert_into_subs(env.subs, flex_elems);

View file

@ -65,15 +65,15 @@ impl Newlines {
pub trait Formattable { pub trait Formattable {
fn is_multiline(&self) -> bool; fn is_multiline(&self) -> bool;
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, 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); self.format_with_options(buf, Parens::NotNeeded, Newlines::No, indent);
} }
} }
@ -87,9 +87,9 @@ where
(*self).is_multiline() (*self).is_multiline()
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -97,7 +97,7 @@ where
(*self).format_with_options(buf, parens, newlines, indent) (*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) (*self).format(buf, indent)
} }
} }
@ -120,9 +120,9 @@ where
self.value.is_multiline() self.value.is_multiline()
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -131,7 +131,7 @@ where
.format_with_options(buf, parens, newlines, indent) .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) self.value.format(buf, indent)
} }
} }
@ -141,9 +141,9 @@ impl<'a> Formattable for UppercaseIdent<'a> {
false false
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
_indent: u16, _indent: u16,
@ -206,9 +206,9 @@ impl<'a> Formattable for TypeAnnotation<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -424,9 +424,9 @@ impl<'a> Formattable for AssignedField<'a, TypeAnnotation<'a>> {
is_multiline_assigned_field_help(self) is_multiline_assigned_field_help(self)
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -441,9 +441,9 @@ impl<'a> Formattable for AssignedField<'a, Expr<'a>> {
is_multiline_assigned_field_help(self) is_multiline_assigned_field_help(self)
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, 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>( fn format_assigned_field_help<T>(
zelf: &AssignedField<'a, T>, zelf: &AssignedField<'_, T>,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
indent: u16, indent: u16,
separator_spaces: usize, separator_spaces: usize,
is_multiline: bool, is_multiline: bool,
@ -545,9 +545,9 @@ impl<'a> Formattable for Tag<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -592,9 +592,9 @@ impl<'a> Formattable for HasClause<'a> {
false false
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -623,9 +623,9 @@ impl<'a> Formattable for HasImpls<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -662,9 +662,9 @@ impl<'a> Formattable for HasAbility<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -703,9 +703,9 @@ impl<'a> Formattable for HasAbilities<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,

View file

@ -15,9 +15,9 @@ impl<'a> Formattable for Defs<'a> {
!self.tags.is_empty() !self.tags.is_empty()
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -57,9 +57,9 @@ impl<'a> Formattable for TypeDef<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -171,9 +171,9 @@ impl<'a> Formattable for TypeHeader<'a> {
self.vars.iter().any(|v| v.is_multiline()) self.vars.iter().any(|v| v.is_multiline())
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -205,9 +205,9 @@ impl<'a> Formattable for ValueDef<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -314,8 +314,8 @@ fn should_outdent(mut rhs: &TypeAnnotation) -> bool {
} }
} }
fn fmt_dbg_in_def<'a, 'buf>( fn fmt_dbg_in_def<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
condition: &'a Loc<Expr<'a>>, condition: &'a Loc<Expr<'a>>,
is_multiline: bool, is_multiline: bool,
indent: u16, indent: u16,
@ -335,8 +335,8 @@ fn fmt_dbg_in_def<'a, 'buf>(
condition.format(buf, return_indent); condition.format(buf, return_indent);
} }
fn fmt_expect<'a, 'buf>( fn fmt_expect<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
condition: &'a Loc<Expr<'a>>, condition: &'a Loc<Expr<'a>>,
is_multiline: bool, is_multiline: bool,
indent: u16, indent: u16,
@ -356,8 +356,8 @@ fn fmt_expect<'a, 'buf>(
condition.format(buf, return_indent); condition.format(buf, return_indent);
} }
fn fmt_expect_fx<'a, 'buf>( fn fmt_expect_fx<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
condition: &'a Loc<Expr<'a>>, condition: &'a Loc<Expr<'a>>,
is_multiline: bool, is_multiline: bool,
indent: u16, indent: u16,
@ -377,28 +377,19 @@ fn fmt_expect_fx<'a, 'buf>(
condition.format(buf, return_indent); condition.format(buf, return_indent);
} }
pub fn fmt_value_def<'a, 'buf>( pub fn fmt_value_def(buf: &mut Buf<'_>, def: &roc_parse::ast::ValueDef<'_>, indent: u16) {
buf: &mut Buf<'buf>,
def: &roc_parse::ast::ValueDef<'a>,
indent: u16,
) {
def.format(buf, indent); 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); 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); defs.format(buf, indent);
} }
pub fn fmt_body<'a, 'buf>( pub fn fmt_body<'a>(buf: &mut Buf<'_>, pattern: &'a Pattern<'a>, body: &'a Expr<'a>, indent: u16) {
buf: &mut Buf<'buf>,
pattern: &'a Pattern<'a>,
body: &'a Expr<'a>,
indent: u16,
) {
pattern.format_with_options(buf, Parens::InApply, Newlines::No, indent); pattern.format_with_options(buf, Parens::InApply, Newlines::No, indent);
buf.indent(indent); buf.indent(indent);
buf.push_str(" ="); buf.push_str(" =");
@ -462,9 +453,9 @@ impl<'a> Formattable for AbilityMember<'a> {
self.name.value.is_multiline() || self.typ.is_multiline() self.name.value.is_multiline() || self.typ.is_multiline()
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,

View file

@ -103,9 +103,9 @@ impl<'a> Formattable for Expr<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, 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::*; use StrSegment::*;
match seg { 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::*; use roc_parse::ast::StrLiteral::*;
match literal { 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>( fn fmt_binops<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
lefts: &'a [(Loc<Expr<'a>>, Loc<BinOp>)], lefts: &'a [(Loc<Expr<'a>>, Loc<BinOp>)],
loc_right_side: &'a Loc<Expr<'a>>, loc_right_side: &'a Loc<Expr<'a>>,
part_of_multi_line_binops: bool, 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); loc_right_side.format_with_options(buf, Parens::InOperator, Newlines::Yes, indent);
} }
fn format_spaces<'a, 'buf>( fn format_spaces(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
spaces: &[CommentOrNewline<'a>], spaces: &[CommentOrNewline<'_>],
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
) { ) {
@ -738,8 +738,8 @@ fn is_when_patterns_multiline(when_branch: &WhenBranch) -> bool {
is_multiline_patterns is_multiline_patterns
} }
fn fmt_when<'a, 'buf>( fn fmt_when<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
loc_condition: &'a Loc<Expr<'a>>, loc_condition: &'a Loc<Expr<'a>>,
branches: &[&'a WhenBranch<'a>], branches: &[&'a WhenBranch<'a>],
indent: u16, indent: u16,
@ -920,8 +920,8 @@ fn fmt_when<'a, 'buf>(
} }
} }
fn fmt_dbg<'a, 'buf>( fn fmt_dbg<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
condition: &'a Loc<Expr<'a>>, condition: &'a Loc<Expr<'a>>,
continuation: &'a Loc<Expr<'a>>, continuation: &'a Loc<Expr<'a>>,
is_multiline: bool, is_multiline: bool,
@ -947,8 +947,8 @@ fn fmt_dbg<'a, 'buf>(
continuation.format(buf, indent); continuation.format(buf, indent);
} }
fn fmt_expect<'a, 'buf>( fn fmt_expect<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
condition: &'a Loc<Expr<'a>>, condition: &'a Loc<Expr<'a>>,
continuation: &'a Loc<Expr<'a>>, continuation: &'a Loc<Expr<'a>>,
is_multiline: bool, is_multiline: bool,
@ -974,8 +974,8 @@ fn fmt_expect<'a, 'buf>(
continuation.format(buf, indent); continuation.format(buf, indent);
} }
fn fmt_if<'a, 'buf>( fn fmt_if<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
branches: &'a [(Loc<Expr<'a>>, Loc<Expr<'a>>)], branches: &'a [(Loc<Expr<'a>>, Loc<Expr<'a>>)],
final_else: &'a Loc<Expr<'a>>, final_else: &'a Loc<Expr<'a>>,
is_multiline: bool, is_multiline: bool,
@ -1123,8 +1123,8 @@ fn fmt_if<'a, 'buf>(
final_else.format(buf, return_indent); final_else.format(buf, return_indent);
} }
fn fmt_closure<'a, 'buf>( fn fmt_closure<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
loc_patterns: &'a [Loc<Pattern<'a>>], loc_patterns: &'a [Loc<Pattern<'a>>],
loc_ret: &'a Loc<Expr<'a>>, loc_ret: &'a Loc<Expr<'a>>,
indent: u16, indent: u16,
@ -1224,8 +1224,8 @@ fn fmt_closure<'a, 'buf>(
} }
} }
fn fmt_backpassing<'a, 'buf>( fn fmt_backpassing<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
loc_patterns: &'a [Loc<Pattern<'a>>], loc_patterns: &'a [Loc<Pattern<'a>>],
loc_body: &'a Loc<Expr<'a>>, loc_body: &'a Loc<Expr<'a>>,
loc_ret: &'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>( fn fmt_record<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
update: Option<&'a Loc<Expr<'a>>>, update: Option<&'a Loc<Expr<'a>>>,
fields: Collection<'a, Loc<AssignedField<'a, Expr<'a>>>>, fields: Collection<'a, Loc<AssignedField<'a, Expr<'a>>>>,
indent: u16, indent: u16,
@ -1404,9 +1404,9 @@ fn fmt_record<'a, 'buf>(
} }
} }
fn format_field_multiline<'a, 'buf, T>( fn format_field_multiline<T>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
field: &AssignedField<'a, T>, field: &AssignedField<'_, T>,
indent: u16, indent: u16,
separator_prefix: &str, separator_prefix: &str,
) where ) where

View file

@ -44,9 +44,9 @@ macro_rules! keywords {
false false
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: crate::annotation::Parens, _parens: crate::annotation::Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -86,9 +86,9 @@ impl<V: Formattable> Formattable for Option<V> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: crate::annotation::Parens, parens: crate::annotation::Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -111,9 +111,9 @@ impl<'a> Formattable for ProvidesTo<'a> {
|| self.to_keyword.is_multiline() || self.to_keyword.is_multiline()
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: crate::annotation::Parens, _parens: crate::annotation::Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -130,9 +130,9 @@ impl<'a> Formattable for PlatformRequires<'a> {
is_collection_multiline(&self.rigids) || self.signature.is_multiline() is_collection_multiline(&self.rigids) || self.signature.is_multiline()
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: crate::annotation::Parens, _parens: crate::annotation::Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, 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() !self.before.is_empty() || !self.after.is_empty() || self.item.is_multiline()
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: crate::annotation::Parens, parens: crate::annotation::Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, 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() self.keyword.is_multiline() || self.item.is_multiline()
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, 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.indent(0);
buf.push_str("interface"); buf.push_str("interface");
let indent = INDENT; 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); 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.indent(0);
buf.push_str("hosted"); buf.push_str("hosted");
let indent = INDENT; 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); 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.indent(0);
buf.push_str("app"); buf.push_str("app");
let indent = INDENT; 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); 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.indent(0);
buf.push_str("package"); buf.push_str("package");
let indent = INDENT; 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); 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.indent(0);
buf.push_str("platform"); buf.push_str("platform");
let indent = INDENT; 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); 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); fmt_collection(buf, indent, Braces::Curly, requires.rigids, Newlines::No);
buf.push_str(" {"); buf.push_str(" {");
@ -276,9 +276,9 @@ impl<'a> Formattable for TypedIdent<'a> {
false false
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, 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.indent(indent);
buf.push('"'); buf.push('"');
buf.push_str_allow_spaces(name.to_str()); 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, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: crate::annotation::Parens, parens: crate::annotation::Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,
@ -335,16 +335,16 @@ impl<'a, T: Formattable> Formattable for Spaced<'a, T> {
} }
} }
fn fmt_imports<'a, 'buf>( fn fmt_imports<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
loc_entries: Collection<'a, Loc<Spaced<'a, ImportsEntry<'a>>>>, loc_entries: Collection<'a, Loc<Spaced<'a, ImportsEntry<'a>>>>,
indent: u16, indent: u16,
) { ) {
fmt_collection(buf, indent, Braces::Square, loc_entries, Newlines::No) fmt_collection(buf, indent, Braces::Square, loc_entries, Newlines::No)
} }
fn fmt_provides<'a, 'buf>( fn fmt_provides<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
loc_exposed_names: Collection<'a, Loc<Spaced<'a, ExposedName<'a>>>>, loc_exposed_names: Collection<'a, Loc<Spaced<'a, ExposedName<'a>>>>,
loc_provided_types: Option<Collection<'a, Loc<Spaced<'a, UppercaseIdent<'a>>>>>, loc_provided_types: Option<Collection<'a, Loc<Spaced<'a, UppercaseIdent<'a>>>>>,
indent: u16, 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 { match to {
To::ExistingPackage(name) => { To::ExistingPackage(name) => {
buf.push_str(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>( fn fmt_exposes<N: Formattable + Copy + core::fmt::Debug>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
loc_entries: Collection<'_, Loc<Spaced<'_, N>>>, loc_entries: Collection<'_, Loc<Spaced<'_, N>>>,
indent: u16, indent: u16,
) { ) {
@ -374,17 +374,17 @@ fn fmt_exposes<'buf, N: Formattable + Copy + core::fmt::Debug>(
} }
pub trait FormatName { pub trait FormatName {
fn format<'buf>(&self, buf: &mut Buf<'buf>); fn format(&self, buf: &mut Buf<'_>);
} }
impl<'a> FormatName for &'a str { impl<'a> FormatName for &'a str {
fn format<'buf>(&self, buf: &mut Buf<'buf>) { fn format(&self, buf: &mut Buf<'_>) {
buf.push_str(self) buf.push_str(self)
} }
} }
impl<'a> FormatName for ModuleName<'a> { 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()); buf.push_str(self.as_str());
} }
} }
@ -394,9 +394,9 @@ impl<'a> Formattable for ModuleName<'a> {
false false
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
_indent: u16, _indent: u16,
@ -410,9 +410,9 @@ impl<'a> Formattable for ExposedName<'a> {
false false
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -423,13 +423,13 @@ impl<'a> Formattable for ExposedName<'a> {
} }
impl<'a> FormatName 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()); buf.push_str(self.as_str());
} }
} }
fn fmt_packages<'a, 'buf>( fn fmt_packages<'a>(
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
loc_entries: Collection<'a, Loc<Spaced<'a, PackageEntry<'a>>>>, loc_entries: Collection<'a, Loc<Spaced<'a, PackageEntry<'a>>>>,
indent: u16, indent: u16,
) { ) {
@ -441,9 +441,9 @@ impl<'a> Formattable for PackageEntry<'a> {
false false
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -457,9 +457,9 @@ impl<'a> Formattable for ImportsEntry<'a> {
false false
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -467,14 +467,14 @@ impl<'a> Formattable for ImportsEntry<'a> {
fmt_imports_entry(buf, self, indent); 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_str(entry.shorthand);
buf.push(':'); buf.push(':');
fmt_default_spaces(buf, entry.spaces_after_shorthand, indent); fmt_default_spaces(buf, entry.spaces_after_shorthand, indent);
fmt_package_name(buf, entry.package_name.value, 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::*; use roc_parse::header::ImportsEntry::*;
buf.indent(indent); buf.indent(indent);

View file

@ -4,12 +4,7 @@ use crate::spaces::{fmt_comments_only, fmt_spaces, NewlineAt, INDENT};
use crate::Buf; use crate::Buf;
use roc_parse::ast::{Base, CommentOrNewline, Pattern, PatternAs}; use roc_parse::ast::{Base, CommentOrNewline, Pattern, PatternAs};
pub fn fmt_pattern<'a, 'buf>( pub fn fmt_pattern<'a>(buf: &mut Buf<'_>, pattern: &'a Pattern<'a>, indent: u16, parens: Parens) {
buf: &mut Buf<'buf>,
pattern: &'a Pattern<'a>,
indent: u16,
parens: Parens,
) {
pattern.format_with_options(buf, parens, Newlines::No, indent); pattern.format_with_options(buf, parens, Newlines::No, indent);
} }
@ -18,9 +13,9 @@ impl<'a> Formattable for PatternAs<'a> {
self.spaces_before.iter().any(|s| s.is_comment()) self.spaces_before.iter().any(|s| s.is_comment())
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
_parens: Parens, _parens: Parens,
_newlines: Newlines, _newlines: Newlines,
indent: u16, indent: u16,
@ -85,9 +80,9 @@ impl<'a> Formattable for Pattern<'a> {
} }
} }
fn format_with_options<'buf>( fn format_with_options(
&self, &self,
buf: &mut Buf<'buf>, buf: &mut Buf<'_>,
parens: Parens, parens: Parens,
newlines: Newlines, newlines: Newlines,
indent: u16, indent: u16,

View file

@ -21,22 +21,14 @@ use crate::{Ast, Buf};
/// The number of spaces to indent. /// The number of spaces to indent.
pub const INDENT: u16 = 4; pub const INDENT: u16 = 4;
pub fn fmt_default_spaces<'a, 'buf>( pub fn fmt_default_spaces(buf: &mut Buf<'_>, spaces: &[CommentOrNewline<'_>], indent: u16) {
buf: &mut Buf<'buf>,
spaces: &[CommentOrNewline<'a>],
indent: u16,
) {
if spaces.is_empty() { if spaces.is_empty() {
buf.spaces(1); buf.spaces(1);
} else { } else {
fmt_spaces(buf, spaces.iter(), indent); fmt_spaces(buf, spaces.iter(), indent);
} }
} }
pub fn fmt_default_newline<'a, 'buf>( pub fn fmt_default_newline(buf: &mut Buf<'_>, spaces: &[CommentOrNewline<'_>], indent: u16) {
buf: &mut Buf<'buf>,
spaces: &[CommentOrNewline<'a>],
indent: u16,
) {
if spaces.is_empty() { if spaces.is_empty() {
buf.newline(); buf.newline();
} else { } else {
@ -153,7 +145,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, // The '#' in a comment should always be preceded by a newline or a space,
// unless it's the very beginning of the buffer. // unless it's the very beginning of the buffer.
if !buf.is_empty() && !buf.ends_with_space() && !buf.ends_with_newline() { if !buf.is_empty() && !buf.ends_with_space() && !buf.ends_with_newline() {
@ -192,7 +184,7 @@ where
count 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, // The "##" in a doc comment should always be preceded by a newline or a space,
// unless it's the very beginning of the buffer. // unless it's the very beginning of the buffer.
if !buf.is_empty() && !buf.ends_with_space() && !buf.ends_with_newline() { if !buf.is_empty() && !buf.ends_with_space() && !buf.ends_with_newline() {

File diff suppressed because it is too large Load diff

View file

@ -62,15 +62,15 @@ pub trait CallConv<GeneralReg: RegTrait, FloatReg: RegTrait, ASM: Assembler<Gene
!Self::float_callee_saved(reg) !Self::float_callee_saved(reg)
} }
fn setup_stack<'a>( fn setup_stack(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'_, u8>,
general_saved_regs: &[GeneralReg], general_saved_regs: &[GeneralReg],
float_saved_regs: &[FloatReg], float_saved_regs: &[FloatReg],
requested_stack_size: i32, requested_stack_size: i32,
fn_call_stack_size: i32, fn_call_stack_size: i32,
) -> i32; ) -> i32;
fn cleanup_stack<'a>( fn cleanup_stack(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'_, u8>,
general_saved_regs: &[GeneralReg], general_saved_regs: &[GeneralReg],
float_saved_regs: &[FloatReg], float_saved_regs: &[FloatReg],
aligned_stack_size: i32, 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. /// 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>, 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>, layout_interner: &mut STLayoutInterner<'a>,
args: &'a [(InLayout<'a>, Symbol)], args: &'a [(InLayout<'a>, Symbol)],
// ret_layout is needed because if it is a complex type, we pass a pointer as the first arg. // 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. /// 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. /// 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>, 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>, layout_interner: &mut STLayoutInterner<'a>,
dst: &Symbol, dst: &Symbol,
args: &[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. /// return_complex_symbol returns the specified complex/non-primative symbol.
/// It uses the layout to determine how the data should be returned. /// 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>, 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>, layout_interner: &mut STLayoutInterner<'a>,
sym: &Symbol, sym: &Symbol,
layout: &InLayout<'a>, 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. /// 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. /// 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>, 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>, layout_interner: &mut STLayoutInterner<'a>,
sym: &Symbol, sym: &Symbol,
layout: &InLayout<'a>, layout: &InLayout<'a>,
@ -184,9 +184,9 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
src2: GeneralReg, src2: GeneralReg,
); );
fn shl_reg64_reg64_reg64<'a, 'r, ASM, CC>( fn shl_reg64_reg64_reg64<'a, ASM, CC>(
buf: &mut Vec<'a, u8>, 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, dst: GeneralReg,
src1: GeneralReg, src1: GeneralReg,
src2: GeneralReg, src2: GeneralReg,
@ -194,9 +194,9 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
ASM: Assembler<GeneralReg, FloatReg>, ASM: Assembler<GeneralReg, FloatReg>,
CC: CallConv<GeneralReg, FloatReg, ASM>; 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>, 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, dst: GeneralReg,
src1: GeneralReg, src1: GeneralReg,
src2: GeneralReg, src2: GeneralReg,
@ -204,9 +204,9 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
ASM: Assembler<GeneralReg, FloatReg>, ASM: Assembler<GeneralReg, FloatReg>,
CC: CallConv<GeneralReg, FloatReg, ASM>; 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>, 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, dst: GeneralReg,
src1: GeneralReg, src1: GeneralReg,
src2: GeneralReg, src2: GeneralReg,
@ -359,9 +359,9 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
src1: GeneralReg, src1: GeneralReg,
src2: 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>, 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, dst: GeneralReg,
src1: GeneralReg, src1: GeneralReg,
src2: GeneralReg, src2: GeneralReg,
@ -369,18 +369,18 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
ASM: Assembler<GeneralReg, FloatReg>, ASM: Assembler<GeneralReg, FloatReg>,
CC: CallConv<GeneralReg, FloatReg, ASM>; 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>, 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, dst: GeneralReg,
src1: GeneralReg, src1: GeneralReg,
src2: GeneralReg, src2: GeneralReg,
) where ) where
ASM: Assembler<GeneralReg, FloatReg>, ASM: Assembler<GeneralReg, FloatReg>,
CC: CallConv<GeneralReg, FloatReg, ASM>; 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>, 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, dst: GeneralReg,
src1: GeneralReg, src1: GeneralReg,
src2: GeneralReg, src2: GeneralReg,
@ -1776,7 +1776,7 @@ impl<
self.storage_manager.with_tmp_general_reg( self.storage_manager.with_tmp_general_reg(
&mut self.buf, &mut self.buf,
|storage_manager, buf, list_ptr| { |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| { storage_manager.with_tmp_general_reg(buf, |storage_manager, buf, tmp| {
// calculate `element_width * index` // calculate `element_width * index`
ASM::mov_reg64_imm64(buf, tmp, ret_stack_size as i64); ASM::mov_reg64_imm64(buf, tmp, ret_stack_size as i64);

View file

@ -216,8 +216,8 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
} }
#[inline(always)] #[inline(always)]
fn setup_stack<'a>( fn setup_stack(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'_, u8>,
saved_general_regs: &[X86_64GeneralReg], saved_general_regs: &[X86_64GeneralReg],
saved_float_regs: &[X86_64FloatReg], saved_float_regs: &[X86_64FloatReg],
requested_stack_size: i32, requested_stack_size: i32,
@ -233,8 +233,8 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
} }
#[inline(always)] #[inline(always)]
fn cleanup_stack<'a>( fn cleanup_stack(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'_, u8>,
saved_general_regs: &[X86_64GeneralReg], saved_general_regs: &[X86_64GeneralReg],
saved_float_regs: &[X86_64FloatReg], saved_float_regs: &[X86_64FloatReg],
aligned_stack_size: i32, aligned_stack_size: i32,
@ -250,11 +250,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
} }
#[inline(always)] #[inline(always)]
fn load_args<'a, 'r>( fn load_args<'a>(
_buf: &mut Vec<'a, u8>, _buf: &mut Vec<'a, u8>,
storage_manager: &mut StorageManager< storage_manager: &mut StorageManager<
'a, 'a,
'r, '_,
X86_64GeneralReg, X86_64GeneralReg,
X86_64FloatReg, X86_64FloatReg,
X86_64Assembler, X86_64Assembler,
@ -284,11 +284,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
} }
#[inline(always)] #[inline(always)]
fn store_args<'a, 'r>( fn store_args<'a>(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'a, u8>,
storage_manager: &mut StorageManager< storage_manager: &mut StorageManager<
'a, 'a,
'r, '_,
X86_64GeneralReg, X86_64GeneralReg,
X86_64FloatReg, X86_64FloatReg,
X86_64Assembler, 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); 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>, buf: &mut Vec<'a, u8>,
storage_manager: &mut StorageManager< storage_manager: &mut StorageManager<
'a, 'a,
'r, '_,
X86_64GeneralReg, X86_64GeneralReg,
X86_64FloatReg, X86_64FloatReg,
X86_64Assembler, 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>, buf: &mut Vec<'a, u8>,
storage_manager: &mut StorageManager< storage_manager: &mut StorageManager<
'a, 'a,
'r, '_,
X86_64GeneralReg, X86_64GeneralReg,
X86_64FloatReg, X86_64FloatReg,
X86_64Assembler, X86_64Assembler,
@ -447,10 +447,10 @@ impl X64_64SystemVStoreArgs {
const FLOAT_PARAM_REGS: &'static [X86_64FloatReg] = X86_64SystemV::FLOAT_PARAM_REGS; const FLOAT_PARAM_REGS: &'static [X86_64FloatReg] = X86_64SystemV::FLOAT_PARAM_REGS;
const FLOAT_RETURN_REGS: &'static [X86_64FloatReg] = X86_64SystemV::FLOAT_RETURN_REGS; const FLOAT_RETURN_REGS: &'static [X86_64FloatReg] = X86_64SystemV::FLOAT_RETURN_REGS;
fn store_arg<'a, 'r>( fn store_arg<'a>(
&mut self, &mut self,
buf: &mut Vec<'a, u8>, 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>, layout_interner: &mut STLayoutInterner<'a>,
sym: Symbol, sym: Symbol,
in_layout: InLayout<'a>, in_layout: InLayout<'a>,
@ -537,10 +537,10 @@ impl X64_64SystemVStoreArgs {
} }
} }
fn store_arg_general<'a, 'r>( fn store_arg_general<'a>(
&mut self, &mut self,
buf: &mut Vec<'a, u8>, buf: &mut Vec<'a, u8>,
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>, storage_manager: &mut X86_64StorageManager<'a, '_, X86_64SystemV>,
sym: Symbol, sym: Symbol,
) { ) {
if self.general_i < Self::GENERAL_PARAM_REGS.len() { 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, &mut self,
buf: &mut Vec<'a, u8>, buf: &mut Vec<'a, u8>,
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>, storage_manager: &mut X86_64StorageManager<'a, '_, X86_64SystemV>,
sym: Symbol, sym: Symbol,
) { ) {
if self.float_i < Self::FLOAT_PARAM_REGS.len() { 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>; StorageManager<'a, 'r, X86_64GeneralReg, X86_64FloatReg, X86_64Assembler, CallConv>;
impl X64_64SystemVLoadArgs { impl X64_64SystemVLoadArgs {
fn load_arg<'a, 'r>( fn load_arg<'a>(
&mut self, &mut self,
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>, storage_manager: &mut X86_64StorageManager<'a, '_, X86_64SystemV>,
layout_interner: &mut STLayoutInterner<'a>, layout_interner: &mut STLayoutInterner<'a>,
sym: Symbol, sym: Symbol,
in_layout: InLayout<'a>, in_layout: InLayout<'a>,
@ -645,9 +645,9 @@ impl X64_64SystemVLoadArgs {
} }
} }
fn load_arg_general<'a, 'r>( fn load_arg_general(
&mut self, &mut self,
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>, storage_manager: &mut X86_64StorageManager<'_, '_, X86_64SystemV>,
sym: Symbol, sym: Symbol,
) { ) {
if self.general_i < X86_64SystemV::GENERAL_PARAM_REGS.len() { 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, &mut self,
storage_manager: &mut X86_64StorageManager<'a, 'r, X86_64SystemV>, storage_manager: &mut X86_64StorageManager<'_, '_, X86_64SystemV>,
sym: Symbol, sym: Symbol,
) { ) {
if self.general_i < X86_64SystemV::GENERAL_PARAM_REGS.len() { 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)] #[inline(always)]
fn setup_stack<'a>( fn setup_stack(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'_, u8>,
saved_general_regs: &[X86_64GeneralReg], saved_general_regs: &[X86_64GeneralReg],
saved_float_regs: &[X86_64FloatReg], saved_float_regs: &[X86_64FloatReg],
requested_stack_size: i32, requested_stack_size: i32,
@ -800,8 +800,8 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
} }
#[inline(always)] #[inline(always)]
fn cleanup_stack<'a>( fn cleanup_stack(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'_, u8>,
saved_general_regs: &[X86_64GeneralReg], saved_general_regs: &[X86_64GeneralReg],
saved_float_regs: &[X86_64FloatReg], saved_float_regs: &[X86_64FloatReg],
aligned_stack_size: i32, aligned_stack_size: i32,
@ -817,9 +817,9 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
} }
#[inline(always)] #[inline(always)]
fn load_args<'a, 'r>( fn load_args<'a>(
_buf: &mut Vec<'a, u8>, _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>, layout_interner: &mut STLayoutInterner<'a>,
args: &'a [(InLayout<'a>, Symbol)], args: &'a [(InLayout<'a>, Symbol)],
ret_layout: &InLayout<'a>, ret_layout: &InLayout<'a>,
@ -861,11 +861,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
} }
#[inline(always)] #[inline(always)]
fn store_args<'a, 'r>( fn store_args<'a>(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'a, u8>,
storage_manager: &mut StorageManager< storage_manager: &mut StorageManager<
'a, 'a,
'r, '_,
X86_64GeneralReg, X86_64GeneralReg,
X86_64FloatReg, X86_64FloatReg,
X86_64Assembler, 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); 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>, _buf: &mut Vec<'a, u8>,
_storage_manager: &mut StorageManager< _storage_manager: &mut StorageManager<
'a, 'a,
'r, '_,
X86_64GeneralReg, X86_64GeneralReg,
X86_64FloatReg, X86_64FloatReg,
X86_64Assembler, X86_64Assembler,
@ -955,11 +955,11 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Windo
todo!("Returning complex symbols for X86_64"); 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>, _buf: &mut Vec<'a, u8>,
_storage_manager: &mut StorageManager< _storage_manager: &mut StorageManager<
'a, 'a,
'r, '_,
X86_64GeneralReg, X86_64GeneralReg,
X86_64FloatReg, X86_64FloatReg,
X86_64Assembler, X86_64Assembler,
@ -985,8 +985,8 @@ impl X86_64WindowsFastcall {
} }
#[inline(always)] #[inline(always)]
fn x86_64_generic_setup_stack<'a>( fn x86_64_generic_setup_stack(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'_, u8>,
saved_general_regs: &[X86_64GeneralReg], saved_general_regs: &[X86_64GeneralReg],
saved_float_regs: &[X86_64FloatReg], saved_float_regs: &[X86_64FloatReg],
requested_stack_size: i32, requested_stack_size: i32,
@ -1042,8 +1042,8 @@ fn x86_64_generic_setup_stack<'a>(
#[inline(always)] #[inline(always)]
#[allow(clippy::unnecessary_wraps)] #[allow(clippy::unnecessary_wraps)]
fn x86_64_generic_cleanup_stack<'a>( fn x86_64_generic_cleanup_stack(
buf: &mut Vec<'a, u8>, buf: &mut Vec<'_, u8>,
saved_general_regs: &[X86_64GeneralReg], saved_general_regs: &[X86_64GeneralReg],
saved_float_regs: &[X86_64FloatReg], saved_float_regs: &[X86_64FloatReg],
aligned_stack_size: i32, aligned_stack_size: i32,
@ -1183,9 +1183,9 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
imul_reg64_reg64(buf, dst, src2); 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>, 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, dst: X86_64GeneralReg,
src1: X86_64GeneralReg, src1: X86_64GeneralReg,
src2: 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>, 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, dst: X86_64GeneralReg,
src1: X86_64GeneralReg, src1: X86_64GeneralReg,
src2: 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); 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>, 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, dst: X86_64GeneralReg,
src1: X86_64GeneralReg, src1: X86_64GeneralReg,
src2: 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) 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>, 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, dst: X86_64GeneralReg,
src1: X86_64GeneralReg, src1: X86_64GeneralReg,
src2: 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) 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>, 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, dst: X86_64GeneralReg,
src1: X86_64GeneralReg, src1: X86_64GeneralReg,
src2: 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) 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>, 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, dst: X86_64GeneralReg,
src1: X86_64GeneralReg, src1: X86_64GeneralReg,
src2: X86_64GeneralReg, src2: X86_64GeneralReg,

View file

@ -885,7 +885,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
self.code_builder.f32_eq(); self.code_builder.f32_eq();
} }
ValueType::F64 => { 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(); self.code_builder.f64_eq();
} }
} }
@ -1114,7 +1114,7 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
match storage { match storage {
StoredValue::VirtualMachineStack { value_type, .. } => { StoredValue::VirtualMachineStack { value_type, .. } => {
match (lit, 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::Float(x), ValueType::F32) => self.code_builder.f32_const(*x as f32),
(Literal::Int(x), ValueType::I64) => { (Literal::Int(x), ValueType::I64) => {
self.code_builder.i64_const(i128::from_ne_bytes(*x) as i64) self.code_builder.i64_const(i128::from_ne_bytes(*x) as i64)

View file

@ -506,7 +506,7 @@ impl<'a> CodeBuilder<'a> {
stack_size stack_size
); );
let new_len = stack_size - pops as usize; let new_len = stack_size - pops;
current_stack.truncate(new_len); current_stack.truncate(new_len);
if push { if push {
current_stack.push(Symbol::WASM_TMP); current_stack.push(Symbol::WASM_TMP);

View file

@ -2347,8 +2347,8 @@ macro_rules! debug_check_ir {
} }
/// Report modules that are imported, but from which nothing is used /// Report modules that are imported, but from which nothing is used
fn report_unused_imported_modules<'a>( fn report_unused_imported_modules(
state: &mut State<'a>, state: &mut State<'_>,
module_id: ModuleId, module_id: ModuleId,
constrained_module: &ConstrainedModule, constrained_module: &ConstrainedModule,
) { ) {

View file

@ -1253,6 +1253,7 @@ define_builtins! {
152 NUM_COUNT_LEADING_ZERO_BITS: "countLeadingZeroBits" 152 NUM_COUNT_LEADING_ZERO_BITS: "countLeadingZeroBits"
153 NUM_COUNT_TRAILING_ZERO_BITS: "countTrailingZeroBits" 153 NUM_COUNT_TRAILING_ZERO_BITS: "countTrailingZeroBits"
154 NUM_COUNT_ONE_BITS: "countOneBits" 154 NUM_COUNT_ONE_BITS: "countOneBits"
155 NUM_ABS_DIFF: "absDiff"
} }
4 BOOL: "Bool" => { 4 BOOL: "Bool" => {
0 BOOL_BOOL: "Bool" exposed_type=true // the Bool.Bool type alias 0 BOOL_BOOL: "Bool" exposed_type=true // the Bool.Bool type alias

View file

@ -25,9 +25,9 @@ use crate::{
/** /**
Insert the reference count operations for procedures. 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, arena: &'a Bump,
layout_interner: &'i STLayoutInterner<'a>, layout_interner: &STLayoutInterner<'a>,
procedures: &mut HashMap<(Symbol, ProcLayout), Proc<'a>, BuildHasherDefault<WyHash>>, 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. // 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. 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, arena: &'a Bump,
mut symbol_rc_types_env: SymbolRcTypesEnv<'a, 'i>, mut symbol_rc_types_env: SymbolRcTypesEnv<'a, '_>,
proc: &mut Proc<'a>, proc: &mut Proc<'a>,
) { ) {
// Clone the symbol_rc_types_env and insert the symbols in the current procedure. // Clone the symbol_rc_types_env and insert the symbols in the current procedure.

View file

@ -279,8 +279,9 @@ impl AbilityAliases {
} }
} }
#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum CapturedSymbols<'a> { pub enum CapturedSymbols<'a> {
#[default]
None, None,
Captured(&'a [(Symbol, Variable)]), Captured(&'a [(Symbol, Variable)]),
} }
@ -294,12 +295,6 @@ impl<'a> CapturedSymbols<'a> {
} }
} }
impl<'a> Default for CapturedSymbols<'a> {
fn default() -> Self {
CapturedSymbols::None
}
}
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct Proc<'a> { pub struct Proc<'a> {
pub name: LambdaName<'a>, pub name: LambdaName<'a>,
@ -2722,8 +2717,8 @@ fn patterns_to_when<'a>(
/// { x } -> body /// { x } -> body
/// ///
/// conversion of one-pattern when expressions will do the most optimal thing /// conversion of one-pattern when expressions will do the most optimal thing
fn pattern_to_when<'a>( fn pattern_to_when(
env: &mut Env<'a, '_>, env: &mut Env<'_, '_>,
pattern_var: Variable, pattern_var: Variable,
pattern: Loc<roc_can::pattern::Pattern>, pattern: Loc<roc_can::pattern::Pattern>,
body_var: Variable, body_var: Variable,
@ -5740,8 +5735,8 @@ fn compile_struct_like<'a, L, UnusedLayout>(
} }
#[inline(always)] #[inline(always)]
fn late_resolve_ability_specialization<'a>( fn late_resolve_ability_specialization(
env: &mut Env<'a, '_>, env: &mut Env<'_, '_>,
member: Symbol, member: Symbol,
specialization_id: Option<SpecializationId>, specialization_id: Option<SpecializationId>,
specialization_var: Variable, specialization_var: Variable,

View file

@ -1193,7 +1193,7 @@ fn extract<'a>(
/// FIND IRRELEVANT BRANCHES /// 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 match branch
.patterns .patterns
.iter() .iter()
@ -1720,7 +1720,7 @@ fn test_to_comparison<'a>(
Test::IsFloat(test_int, precision) => { Test::IsFloat(test_int, precision) => {
// TODO maybe we can actually use i64 comparison here? // 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 = Expr::Literal(Literal::Float(test_float));
let lhs_symbol = env.unique_symbol(); let lhs_symbol = env.unique_symbol();
stores.push((lhs_symbol, Layout::float_width(precision), lhs)); stores.push((lhs_symbol, Layout::float_width(precision), lhs));
@ -2240,7 +2240,7 @@ fn decide_to_branching<'a>(
let tag = match test { let tag = match test {
Test::IsInt(v, _) => i128::from_ne_bytes(v) as u64, 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::IsBit(v) => v as u64,
Test::IsByte { tag_id, .. } => tag_id as u64, Test::IsByte { tag_id, .. } => tag_id as u64,
Test::IsCtor { tag_id, .. } => tag_id as u64, Test::IsCtor { tag_id, .. } => tag_id as u64,

View file

@ -457,7 +457,7 @@ macro_rules! cached {
} }
pub type TagIdIntType = u16; 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; const GENERATE_NULLABLE: bool = true;
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]
@ -898,7 +898,7 @@ impl<'a> UnionLayout<'a> {
} => { } => {
debug_assert_ne!(nullable_id, tag_id != 0); debug_assert_ne!(nullable_id, tag_id != 0);
other_fields[index as usize] other_fields[index]
} }
}; };

View file

@ -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()); assert!(interner.is_empty());
$( $(
interner.insert($layout); interner.insert($layout);

View file

@ -105,14 +105,14 @@ impl Position {
#[must_use] #[must_use]
pub const fn bump_column(self, count: u32) -> Self { pub const fn bump_column(self, count: u32) -> Self {
Self { Self {
offset: self.offset + count as u32, offset: self.offset + count,
} }
} }
#[must_use] #[must_use]
pub fn bump_invisible(self, count: u32) -> Self { pub fn bump_invisible(self, count: u32) -> Self {
Self { Self {
offset: self.offset + count as u32, offset: self.offset + count,
} }
} }
@ -126,7 +126,7 @@ impl Position {
#[must_use] #[must_use]
pub const fn sub(self, count: u32) -> Self { pub const fn sub(self, count: u32) -> Self {
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]; let column = offset - self.line_offsets[line];
LineColumn { LineColumn {
line: line as u32, line: line as u32,
column: column as u32, column,
} }
} }

View file

@ -2537,14 +2537,14 @@ enum TypeToVar {
} }
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
fn type_to_variable<'a>( fn type_to_variable(
subs: &mut Subs, subs: &mut Subs,
rank: Rank, rank: Rank,
pools: &mut Pools, pools: &mut Pools,
problems: &mut Vec<TypeError>, problems: &mut Vec<TypeError>,
abilities_store: &AbilitiesStore, abilities_store: &AbilitiesStore,
obligation_cache: &mut ObligationCache, obligation_cache: &mut ObligationCache,
arena: &'a bumpalo::Bump, arena: &bumpalo::Bump,
aliases: &mut Aliases, aliases: &mut Aliases,
types: &mut Types, types: &mut Types,
typ: Index<TypeTag>, typ: Index<TypeTag>,

File diff suppressed because it is too large Load diff

View file

@ -3998,3 +3998,60 @@ fn num_count_one_bits() {
assert_evals_to!(r#"Num.countOneBits 0u32"#, 0, usize); assert_evals_to!(r#"Num.countOneBits 0u32"#, 0, usize);
assert_evals_to!(r#"Num.countOneBits 0b0010_1111u64"#, 5, usize); assert_evals_to!(r#"Num.countOneBits 0b0010_1111u64"#, 5, usize);
} }
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn num_abs_diff_int() {
assert_evals_to!(r#"Num.absDiff 0u8 0u8"#, 0, u8);
assert_evals_to!(r#"Num.absDiff 1u8 2u8"#, 1, u8);
assert_evals_to!(r#"Num.absDiff 2u8 1u8"#, 1, u8);
assert_evals_to!(r#"Num.absDiff -1 1"#, 2, i64);
assert_evals_to!(r#"Num.absDiff 1 -1"#, 2, i64);
assert_evals_to!(r#"Num.absDiff Num.minI64 -1"#, i64::MAX, i64);
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn num_abs_diff_large_bits() {
assert_evals_to!(r#"Num.absDiff 0u128 0u128"#, 0, u128);
assert_evals_to!(r#"Num.absDiff 1u128 2u128"#, 1, u128);
assert_evals_to!(r#"Num.absDiff -1i128 1i128"#, 2, i128);
assert_evals_to!(r#"Num.absDiff Num.minI128 -1i128"#, i128::MAX, i128);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn num_abs_diff_float() {
assert_evals_to!(r#"Num.absDiff 0.0 0.0"#, 0.0, f64);
assert_evals_to!(r#"Num.absDiff 1.0 2.0"#, 1.0, f64);
assert_evals_to!(r#"Num.absDiff 2.0 1.0"#, 1.0, f64);
assert_evals_to!(r#"Num.absDiff -1.0 1.0"#, 2.0, f64);
assert_evals_to!(r#"Num.absDiff 1.0 -1.0"#, 2.0, f64);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[should_panic(expected = r#"Roc failed with message: "integer subtraction overflowed!"#)]
fn num_abs_max_overflow() {
assert_evals_to!(r#"Num.absDiff Num.maxI64 -1"#, 0, i64);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[should_panic(expected = r#"Roc failed with message: "integer subtraction overflowed!"#)]
fn num_abs_int_min_overflow() {
assert_evals_to!(r#"Num.absDiff Num.minI64 0"#, 0, i64);
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[should_panic(expected = r#"Roc failed with message: "integer subtraction overflowed!"#)]
fn num_abs_large_bits_min_overflow() {
assert_evals_to!(r#"Num.absDiff Num.minI128 0"#, 0, i128);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn num_abs_float_overflow() {
assert_evals_to!("Num.absDiff Num.maxF64 Num.minF64", f64::INFINITY, f64);
}

View file

@ -86,16 +86,16 @@ procedure List.92 (List.430, List.431, List.432):
ret List.515; ret List.515;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.277 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.280 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.278 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.278; ret Num.281;
procedure Num.77 (#Attr.2, #Attr.3): procedure Num.77 (#Attr.2, #Attr.3):
let Num.276 : U64 = lowlevel NumSubSaturated #Attr.2 #Attr.3; let Num.279 : U64 = lowlevel NumSubSaturated #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Test.1 (Test.2): procedure Test.1 (Test.2):
let Test.13 : U64 = 0i64; let Test.13 : U64 = 0i64;

View file

@ -48,8 +48,8 @@ procedure List.9 (List.287):
ret List.496; ret List.496;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.275 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.278 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Result.5 (Result.12, Result.13): procedure Result.5 (Result.12, Result.13):
let Result.39 : U8 = 1i64; let Result.39 : U8 = 1i64;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.276 : I128 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.279 : I128 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Test.0 (): procedure Test.0 ():
let Test.6 : I128 = 18446744073709551616i64; let Test.6 : I128 = 18446744073709551616i64;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : U128 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : U128 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.2 : U128 = 170141183460469231731687303715884105728u128; let Test.2 : U128 = 170141183460469231731687303715884105728u128;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.2 : U64 = 9999999999999999999i64; let Test.2 : U64 = 9999999999999999999i64;

View file

@ -40,12 +40,12 @@ procedure List.92 (List.430, List.431, List.432):
ret List.497; ret List.497;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.276 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.279 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Str.3 (#Attr.2, #Attr.3): procedure Str.3 (#Attr.2, #Attr.3):
let Str.300 : Str = lowlevel StrConcat #Attr.2 #Attr.3; let Str.300 : Str = lowlevel StrConcat #Attr.2 #Attr.3;

View file

@ -74,12 +74,12 @@ procedure List.82 (List.526, List.527, List.528):
jump List.508 List.526 List.527 List.528; jump List.508 List.526 List.527 List.528;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.276 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.279 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.278 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.281 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.278; ret Num.281;
procedure Test.0 (): procedure Test.0 ():
let Test.3 : {} = Struct {}; let Test.3 : {} = Struct {};

View file

@ -25,8 +25,8 @@ procedure List.66 (#Attr.2, #Attr.3):
ret List.499; ret List.499;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.275 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.278 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.2 (Test.5): procedure Test.2 (Test.5):
dec Test.5; dec Test.5;

View file

@ -299,24 +299,24 @@ procedure List.92 (List.430, List.431, List.432):
ret List.592; ret List.592;
procedure Num.127 (#Attr.2): procedure Num.127 (#Attr.2):
let Num.301 : U8 = lowlevel NumIntCast #Attr.2; let Num.304 : U8 = lowlevel NumIntCast #Attr.2;
ret Num.301;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.304 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.304; ret Num.304;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.302 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.307 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.302; ret Num.307;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.305 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.305 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.305; ret Num.305;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.308 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.308;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.303 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.306 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.303; ret Num.306;
procedure Str.12 (#Attr.2): procedure Str.12 (#Attr.2):
let Str.315 : List U8 = lowlevel StrToUtf8 #Attr.2; let Str.315 : List U8 = lowlevel StrToUtf8 #Attr.2;

View file

@ -176,24 +176,24 @@ procedure List.92 (List.430, List.431, List.432):
ret List.525; ret List.525;
procedure Num.127 (#Attr.2): procedure Num.127 (#Attr.2):
let Num.282 : U8 = lowlevel NumIntCast #Attr.2; let Num.285 : U8 = lowlevel NumIntCast #Attr.2;
ret Num.282;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.285 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.285; ret Num.285;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.283 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.288 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.283; ret Num.288;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.286 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.286 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.286; ret Num.286;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.289 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.289;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.284 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.287 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.284; ret Num.287;
procedure Str.12 (#Attr.2): procedure Str.12 (#Attr.2):
let Str.313 : List U8 = lowlevel StrToUtf8 #Attr.2; let Str.313 : List U8 = lowlevel StrToUtf8 #Attr.2;

View file

@ -184,24 +184,24 @@ procedure List.92 (List.430, List.431, List.432):
ret List.525; ret List.525;
procedure Num.127 (#Attr.2): procedure Num.127 (#Attr.2):
let Num.282 : U8 = lowlevel NumIntCast #Attr.2; let Num.285 : U8 = lowlevel NumIntCast #Attr.2;
ret Num.282;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.285 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.285; ret Num.285;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.283 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.288 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.283; ret Num.288;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.286 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.286 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.286; ret Num.286;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.289 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.289;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.284 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.287 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.284; ret Num.287;
procedure Str.12 (#Attr.2): procedure Str.12 (#Attr.2):
let Str.313 : List U8 = lowlevel StrToUtf8 #Attr.2; let Str.313 : List U8 = lowlevel StrToUtf8 #Attr.2;

View file

@ -53,8 +53,8 @@ procedure List.8 (#Attr.2, #Attr.3):
ret List.504; ret List.504;
procedure Num.127 (#Attr.2): procedure Num.127 (#Attr.2):
let Num.276 : U8 = lowlevel NumIntCast #Attr.2; let Num.279 : U8 = lowlevel NumIntCast #Attr.2;
ret Num.276; ret Num.279;
procedure Str.12 (#Attr.2): procedure Str.12 (#Attr.2):
let Str.312 : List U8 = lowlevel StrToUtf8 #Attr.2; let Str.312 : List U8 = lowlevel StrToUtf8 #Attr.2;

View file

@ -185,24 +185,24 @@ procedure List.92 (List.430, List.431, List.432):
ret List.531; ret List.531;
procedure Num.127 (#Attr.2): procedure Num.127 (#Attr.2):
let Num.284 : U8 = lowlevel NumIntCast #Attr.2; let Num.287 : U8 = lowlevel NumIntCast #Attr.2;
ret Num.284;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.287 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.287; ret Num.287;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.285 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.290 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.285; ret Num.290;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.288 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.288 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.288; ret Num.288;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.291 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.291;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.286 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.289 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.286; ret Num.289;
procedure Str.12 (#Attr.2): procedure Str.12 (#Attr.2):
let Str.313 : List U8 = lowlevel StrToUtf8 #Attr.2; let Str.313 : List U8 = lowlevel StrToUtf8 #Attr.2;

View file

@ -191,24 +191,24 @@ procedure List.92 (List.430, List.431, List.432):
ret List.531; ret List.531;
procedure Num.127 (#Attr.2): procedure Num.127 (#Attr.2):
let Num.284 : U8 = lowlevel NumIntCast #Attr.2; let Num.287 : U8 = lowlevel NumIntCast #Attr.2;
ret Num.284;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.287 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.287; ret Num.287;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.285 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.290 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.285; ret Num.290;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.288 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.288 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.288; ret Num.288;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.291 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.291;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.286 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.289 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.286; ret Num.289;
procedure Str.12 (#Attr.2): procedure Str.12 (#Attr.2):
let Str.313 : List U8 = lowlevel StrToUtf8 #Attr.2; let Str.313 : List U8 = lowlevel StrToUtf8 #Attr.2;

View file

@ -1,10 +1,10 @@
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.276 : I64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.279 : I64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Num.21 (#Attr.2, #Attr.3): procedure Num.21 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumMul #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.15, Test.16): procedure Test.1 (Test.15, Test.16):
joinpoint Test.7 Test.2 Test.3: joinpoint Test.7 Test.2 Test.3:

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.8): procedure Test.1 (Test.8):
let Test.3 : I64 = 10i64; let Test.3 : I64 = 10i64;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.276 : U8 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.279 : U8 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Test.1 (Test.9): procedure Test.1 (Test.9):
let Test.4 : U8 = 10i64; let Test.4 : U8 = 10i64;

View file

@ -3,8 +3,8 @@ procedure Bool.1 ():
ret Bool.23; ret Bool.23;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.3 (Test.4): procedure Test.3 (Test.4):
ret Test.4; ret Test.4;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.277 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.280 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Test.2 (Test.3): procedure Test.2 (Test.3):
switch Test.3: switch Test.3:

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.276 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.279 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Test.2 (Test.3, Test.1): procedure Test.2 (Test.3, Test.1):
let Test.17 : Int1 = false; let Test.17 : Int1 = false;

View file

@ -3,8 +3,8 @@ procedure List.6 (#Attr.2):
ret List.494; ret List.494;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.277 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.280 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Test.0 (): procedure Test.0 ():
let Test.1 : List I64 = Array [1i64, 2i64]; let Test.1 : List I64 = Array [1i64, 2i64];

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.2 : I64 = 1i64; let Test.2 : I64 = 1i64;

View file

@ -1,6 +1,6 @@
procedure Num.45 (#Attr.2): procedure Num.45 (#Attr.2):
let Num.275 : I64 = lowlevel NumRound #Attr.2; let Num.278 : I64 = lowlevel NumRound #Attr.2;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.2 : Float64 = 3.6f64; let Test.2 : Float64 = 3.6f64;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.1 : I64 = 3i64; let Test.1 : I64 = 3i64;

View file

@ -1,22 +1,22 @@
procedure Num.30 (#Attr.2): procedure Num.30 (#Attr.2):
let Num.282 : I64 = 0i64; let Num.285 : I64 = 0i64;
let Num.281 : Int1 = lowlevel Eq #Attr.2 Num.282; let Num.284 : Int1 = lowlevel Eq #Attr.2 Num.285;
ret Num.281; ret Num.284;
procedure Num.39 (#Attr.2, #Attr.3): procedure Num.39 (#Attr.2, #Attr.3):
let Num.277 : I64 = lowlevel NumDivTruncUnchecked #Attr.2 #Attr.3; let Num.280 : I64 = lowlevel NumDivTruncUnchecked #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Num.40 (Num.247, Num.248): procedure Num.40 (Num.250, Num.251):
let Num.278 : Int1 = CallByName Num.30 Num.248; let Num.281 : Int1 = CallByName Num.30 Num.251;
if Num.278 then if Num.281 then
let Num.280 : {} = Struct {}; let Num.283 : {} = Struct {};
let Num.279 : [C {}, C I64] = TagId(0) Num.280; let Num.282 : [C {}, C I64] = TagId(0) Num.283;
ret Num.279; ret Num.282;
else else
let Num.276 : I64 = CallByName Num.39 Num.247 Num.248; let Num.279 : I64 = CallByName Num.39 Num.250 Num.251;
let Num.275 : [C {}, C I64] = TagId(1) Num.276; let Num.278 : [C {}, C I64] = TagId(1) Num.279;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.8 : I64 = 1000i64; let Test.8 : I64 = 1000i64;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.10 : I64 = 41i64; let Test.10 : I64 = 41i64;

View file

@ -44,8 +44,8 @@ procedure List.9 (List.287):
ret List.496; ret List.496;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.275 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.278 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Str.27 (Str.99): procedure Str.27 (Str.99):
let Str.298 : [C Int1, C I64] = CallByName Str.72 Str.99; let Str.298 : [C Int1, C I64] = CallByName Str.72 Str.99;

View file

@ -336,16 +336,16 @@ procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
ret List.505; ret List.505;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.276 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.279 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.278 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.281 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.278; ret Num.281;
procedure Num.77 (#Attr.2, #Attr.3): procedure Num.77 (#Attr.2, #Attr.3):
let Num.280 : U64 = lowlevel NumSubSaturated #Attr.2 #Attr.3; let Num.283 : U64 = lowlevel NumSubSaturated #Attr.2 #Attr.3;
ret Num.280; ret Num.283;
procedure Str.48 (#Attr.2, #Attr.3, #Attr.4): procedure Str.48 (#Attr.2, #Attr.3, #Attr.4):
let Str.307 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; let Str.307 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4;

View file

@ -302,16 +302,16 @@ procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
ret List.499; ret List.499;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.276 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.279 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.278 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.281 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.278; ret Num.281;
procedure Num.77 (#Attr.2, #Attr.3): procedure Num.77 (#Attr.2, #Attr.3):
let Num.280 : U64 = lowlevel NumSubSaturated #Attr.2 #Attr.3; let Num.283 : U64 = lowlevel NumSubSaturated #Attr.2 #Attr.3;
ret Num.280; ret Num.283;
procedure Str.12 (#Attr.2): procedure Str.12 (#Attr.2):
let Str.307 : List U8 = lowlevel StrToUtf8 #Attr.2; let Str.307 : List U8 = lowlevel StrToUtf8 #Attr.2;

View file

@ -1,10 +1,10 @@
procedure Num.96 (#Attr.2): procedure Num.96 (#Attr.2):
let Num.275 : Str = lowlevel NumToStr #Attr.2; let Num.278 : Str = lowlevel NumToStr #Attr.2;
ret Num.275; ret Num.278;
procedure Num.96 (#Attr.2): procedure Num.96 (#Attr.2):
let Num.276 : Str = lowlevel NumToStr #Attr.2; let Num.279 : Str = lowlevel NumToStr #Attr.2;
ret Num.276; ret Num.279;
procedure Test.1 (Test.4): procedure Test.1 (Test.4):
let Test.13 : [C U8, C U64] = TagId(1) Test.4; let Test.13 : [C U8, C U64] = TagId(1) Test.4;

View file

@ -7,12 +7,12 @@ procedure Bool.2 ():
ret Bool.24; ret Bool.24;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Num.21 (#Attr.2, #Attr.3): procedure Num.21 (#Attr.2, #Attr.3):
let Num.276 : U64 = lowlevel NumMul #Attr.2 #Attr.3; let Num.279 : U64 = lowlevel NumMul #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Test.0 (Test.8): procedure Test.0 (Test.8):
let Test.20 : Int1 = CallByName Bool.2; let Test.20 : Int1 = CallByName Bool.2;

View file

@ -36,12 +36,12 @@ procedure List.92 (List.430, List.431, List.432):
ret List.497; ret List.497;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.276 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.279 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Test.7 (Test.11, Test.12): procedure Test.7 (Test.11, Test.12):
let Test.17 : {[<rnu>C *self, <null>], [<rnu><null>, C {[<rnu>C *self, <null>], *self}]} = Struct {Test.12, Test.11}; let Test.17 : {[<rnu>C *self, <null>], [<rnu><null>, C {[<rnu>C *self, <null>], *self}]} = Struct {Test.12, Test.11};

View file

@ -24,12 +24,12 @@ procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
ret List.501; ret List.501;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.276 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.279 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Test.1 (): procedure Test.1 ():
let Test.8 : List I64 = Array [1i64, 2i64, 3i64]; let Test.8 : List I64 = Array [1i64, 2i64, 3i64];

View file

@ -21,8 +21,8 @@ procedure List.66 (#Attr.2, #Attr.3):
ret List.499; ret List.499;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.275 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.278 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.2): procedure Test.1 (Test.2):
let Test.6 : List I64 = Array [1i64, 2i64, 3i64]; let Test.6 : List I64 = Array [1i64, 2i64, 3i64];

View file

@ -7,8 +7,8 @@ procedure List.6 (#Attr.2):
ret List.495; ret List.495;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.1 : List I64 = Array [1i64, 2i64, 3i64]; let Test.1 : List I64 = Array [1i64, 2i64, 3i64];

View file

@ -26,8 +26,8 @@ procedure List.66 (#Attr.2, #Attr.3):
ret List.499; ret List.499;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.275 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.278 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Str.16 (#Attr.2, #Attr.3): procedure Str.16 (#Attr.2, #Attr.3):
let Str.298 : Str = lowlevel StrRepeat #Attr.2 #Attr.3; let Str.298 : Str = lowlevel StrRepeat #Attr.2 #Attr.3;

View file

@ -26,8 +26,8 @@ procedure List.66 (#Attr.2, #Attr.3):
ret List.499; ret List.499;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.275 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.278 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Str.3 (#Attr.2, #Attr.3): procedure Str.3 (#Attr.2, #Attr.3):
let Str.299 : Str = lowlevel StrConcat #Attr.2 #Attr.3; let Str.299 : Str = lowlevel StrConcat #Attr.2 #Attr.3;

View file

@ -21,8 +21,8 @@ procedure List.5 (#Attr.2, #Attr.3):
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.277 : U8 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.280 : U8 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Test.4 (Test.5, #Attr.12): procedure Test.4 (Test.5, #Attr.12):
let Test.1 : U8 = UnionAtIndex (Id 0) (Index 0) #Attr.12; let Test.1 : U8 = UnionAtIndex (Id 0) (Index 0) #Attr.12;

View file

@ -24,8 +24,8 @@ procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
ret List.499; ret List.499;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.275 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.278 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.2 (Test.3): procedure Test.2 (Test.3):
let Test.6 : U64 = 0i64; let Test.6 : U64 = 0i64;

View file

@ -8,8 +8,8 @@ procedure List.59 (List.282):
ret List.494; ret List.494;
procedure Num.46 (#Attr.2, #Attr.3): procedure Num.46 (#Attr.2, #Attr.3):
let Num.275 : U8 = lowlevel NumCompare #Attr.2 #Attr.3; let Num.278 : U8 = lowlevel NumCompare #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.2 : List I64 = Array [4i64, 3i64, 2i64, 1i64]; let Test.2 : List I64 = Array [4i64, 3i64, 2i64, 1i64];

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.19 : I64 = 41i64; let Test.19 : I64 = 41i64;

View file

@ -1,6 +1,6 @@
procedure Num.37 (#Attr.2, #Attr.3): procedure Num.37 (#Attr.2, #Attr.3):
let Num.275 : Float64 = lowlevel NumDivFrac #Attr.2 #Attr.3; let Num.278 : Float64 = lowlevel NumDivFrac #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.0 (): procedure Test.0 ():
let Test.2 : Float64 = 1f64; let Test.2 : Float64 = 1f64;

View file

@ -1,6 +1,6 @@
procedure Num.21 (#Attr.2, #Attr.3): procedure Num.21 (#Attr.2, #Attr.3):
let Num.277 : I64 = lowlevel NumMul #Attr.2 #Attr.3; let Num.280 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Test.1 (Test.6): procedure Test.1 (Test.6):
let Test.21 : Int1 = false; let Test.21 : Int1 = false;

View file

@ -1,14 +1,14 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.276 : I64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.279 : I64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.277 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.280 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Test.1 (Test.24, Test.25, Test.26): procedure Test.1 (Test.24, Test.25, Test.26):
joinpoint Test.12 Test.2 Test.3 Test.4: joinpoint Test.12 Test.2 Test.3 Test.4:

View file

@ -42,8 +42,8 @@ procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
ret List.499; ret List.499;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.277 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.280 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Test.1 (Test.2): procedure Test.1 (Test.2):
let Test.28 : U64 = 0i64; let Test.28 : U64 = 0i64;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.4): procedure Test.1 (Test.4):
let Test.2 : I64 = StructAtIndex 0 Test.4; let Test.2 : I64 = StructAtIndex 0 Test.4;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.4): procedure Test.1 (Test.4):
let Test.2 : I64 = 10i64; let Test.2 : I64 = 10i64;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.2): procedure Test.1 (Test.2):
let Test.3 : I64 = StructAtIndex 0 Test.2; let Test.3 : I64 = StructAtIndex 0 Test.2;

View file

@ -1,6 +1,6 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.2): procedure Test.1 (Test.2):
let Test.3 : I64 = 10i64; let Test.3 : I64 = 10i64;

View file

@ -3,8 +3,8 @@ procedure Bool.2 ():
ret Bool.23; ret Bool.23;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : U32 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : U32 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.2): procedure Test.1 (Test.2):
let Test.8 : U32 = 0i64; let Test.8 : U32 = 0i64;

View file

@ -3,12 +3,12 @@ procedure Bool.11 (#Attr.2, #Attr.3):
ret Bool.23; ret Bool.23;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.276 : U8 = lowlevel NumSub #Attr.2 #Attr.3; let Num.279 : U8 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Num.21 (#Attr.2, #Attr.3): procedure Num.21 (#Attr.2, #Attr.3):
let Num.275 : U8 = lowlevel NumMul #Attr.2 #Attr.3; let Num.278 : U8 = lowlevel NumMul #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.26, Test.27): procedure Test.1 (Test.26, Test.27):
joinpoint Test.11 Test.2 Test.3: joinpoint Test.11 Test.2 Test.3:

View file

@ -1,6 +1,6 @@
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Str.3 (#Attr.2, #Attr.3): procedure Str.3 (#Attr.2, #Attr.3):
let Str.300 : Str = lowlevel StrConcat #Attr.2 #Attr.3; let Str.300 : Str = lowlevel StrConcat #Attr.2 #Attr.3;

View file

@ -42,8 +42,8 @@ procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
ret List.499; ret List.499;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.22 (#Attr.2, #Attr.3):
let Num.277 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.280 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.277; ret Num.280;
procedure Test.1 (Test.2, Test.3, Test.4): procedure Test.1 (Test.2, Test.3, Test.4):
inc Test.4; inc Test.4;

View file

@ -3,12 +3,12 @@ procedure Bool.2 ():
ret Bool.24; ret Bool.24;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.276 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.279 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Num.21 (#Attr.2, #Attr.3): procedure Num.21 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumMul #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.1 (Test.2, Test.3): procedure Test.1 (Test.2, Test.3):
let Test.15 : U8 = GetTagId Test.2; let Test.15 : U8 = GetTagId Test.2;

View file

@ -3,12 +3,12 @@ procedure Bool.2 ():
ret Bool.23; ret Bool.23;
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.276 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.279 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Num.21 (#Attr.2, #Attr.3): procedure Num.21 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumMul #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Test.6 (Test.8, #Attr.12): procedure Test.6 (Test.8, #Attr.12):
let Test.4 : I64 = UnionAtIndex (Id 0) (Index 0) #Attr.12; let Test.4 : I64 = UnionAtIndex (Id 0) (Index 0) #Attr.12;

View file

@ -1,10 +1,10 @@
procedure Num.19 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.275 : I64 = lowlevel NumAdd #Attr.2 #Attr.3; let Num.278 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.275; ret Num.278;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.276 : I64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.279 : I64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.276; ret Num.279;
procedure Test.1 (Test.15, Test.16): procedure Test.1 (Test.15, Test.16):
joinpoint Test.7 Test.2 Test.3: joinpoint Test.7 Test.2 Test.3:

View file

@ -170,24 +170,24 @@ procedure List.92 (List.430, List.431, List.432):
ret List.529; ret List.529;
procedure Num.127 (#Attr.2): procedure Num.127 (#Attr.2):
let Num.284 : U8 = lowlevel NumIntCast #Attr.2; let Num.287 : U8 = lowlevel NumIntCast #Attr.2;
ret Num.284;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.287 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.287; ret Num.287;
procedure Num.20 (#Attr.2, #Attr.3): procedure Num.19 (#Attr.2, #Attr.3):
let Num.285 : U64 = lowlevel NumSub #Attr.2 #Attr.3; let Num.290 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
ret Num.285; ret Num.290;
procedure Num.22 (#Attr.2, #Attr.3): procedure Num.20 (#Attr.2, #Attr.3):
let Num.288 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; let Num.288 : U64 = lowlevel NumSub #Attr.2 #Attr.3;
ret Num.288; ret Num.288;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.291 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
ret Num.291;
procedure Num.24 (#Attr.2, #Attr.3): procedure Num.24 (#Attr.2, #Attr.3):
let Num.286 : Int1 = lowlevel NumGt #Attr.2 #Attr.3; let Num.289 : Int1 = lowlevel NumGt #Attr.2 #Attr.3;
ret Num.286; ret Num.289;
procedure Str.12 (#Attr.2): procedure Str.12 (#Attr.2):
let Str.299 : List U8 = lowlevel StrToUtf8 #Attr.2; let Str.299 : List U8 = lowlevel StrToUtf8 #Attr.2;

Some files were not shown because too many files have changed in this diff Show more