mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Merge pull request #5324 from roc-lang/rust_version_upgrade
WIP Rust version upgrade
This commit is contained in:
commit
ff6ec21a09
37 changed files with 682 additions and 712 deletions
4
.github/workflows/windows_release_build.yml
vendored
4
.github/workflows/windows_release_build.yml
vendored
|
@ -32,8 +32,8 @@ jobs:
|
||||||
- name: zig version
|
- name: zig version
|
||||||
run: zig version
|
run: zig version
|
||||||
|
|
||||||
- name: install rust nightly 1.65
|
- name: install rust nightly 1.66
|
||||||
run: rustup install nightly-2022-09-17
|
run: rustup install nightly-2022-10-30
|
||||||
|
|
||||||
- name: set up llvm 13
|
- name: set up llvm 13
|
||||||
run: |
|
run: |
|
||||||
|
|
4
.github/workflows/windows_tests.yml
vendored
4
.github/workflows/windows_tests.yml
vendored
|
@ -36,8 +36,8 @@ jobs:
|
||||||
- name: zig version
|
- name: zig version
|
||||||
run: zig version
|
run: zig version
|
||||||
|
|
||||||
- name: install rust nightly 1.65
|
- name: install rust nightly 1.66
|
||||||
run: rustup install nightly-2022-09-17
|
run: rustup install nightly-2022-10-30
|
||||||
|
|
||||||
- name: set up llvm 13
|
- name: set up llvm 13
|
||||||
run: |
|
run: |
|
||||||
|
|
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -764,7 +764,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "criterion"
|
name = "criterion"
|
||||||
version = "0.3.5"
|
version = "0.3.5"
|
||||||
source = "git+https://github.com/Anton-4/criterion.rs#3e46ad2b234e36928fb5234d36cf53b5837cbb87"
|
source = "git+https://github.com/Anton-4/criterion.rs?rev=30ea0c5#30ea0c592d7423ed79772234fab13108d1f8de77"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"cast",
|
"cast",
|
||||||
|
@ -789,7 +789,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "criterion-plot"
|
name = "criterion-plot"
|
||||||
version = "0.4.3"
|
version = "0.4.3"
|
||||||
source = "git+https://github.com/Anton-4/criterion.rs#3e46ad2b234e36928fb5234d36cf53b5837cbb87"
|
source = "git+https://github.com/Anton-4/criterion.rs?rev=30ea0c5#30ea0c592d7423ed79772234fab13108d1f8de77"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cast",
|
"cast",
|
||||||
"itertools 0.9.0",
|
"itertools 0.9.0",
|
||||||
|
|
|
@ -88,8 +88,8 @@ confy = { git = 'https://github.com/rust-cli/confy', features = ["yaml_conf"], d
|
||||||
console_error_panic_hook = "0.1.7"
|
console_error_panic_hook = "0.1.7"
|
||||||
const_format = { version = "0.2.30", features = ["const_generics"] }
|
const_format = { version = "0.2.30", features = ["const_generics"] }
|
||||||
copypasta = "0.8.2"
|
copypasta = "0.8.2"
|
||||||
criterion = { git = "https://github.com/Anton-4/criterion.rs", features = ["html_reports"] }
|
criterion = { git = "https://github.com/Anton-4/criterion.rs", features = ["html_reports"], rev = "30ea0c5" }
|
||||||
criterion-perf-events = { git = "https://github.com/Anton-4/criterion-perf-events" }
|
criterion-perf-events = { git = "https://github.com/Anton-4/criterion-perf-events", rev = "0f38c3e" }
|
||||||
crossbeam = "0.8.2"
|
crossbeam = "0.8.2"
|
||||||
dircpy = "0.3.14"
|
dircpy = "0.3.14"
|
||||||
distance = "0.4.0"
|
distance = "0.4.0"
|
||||||
|
|
|
@ -636,7 +636,7 @@ pub fn rebuild_host(
|
||||||
// on windows, we need the nightly toolchain so we can use `-Z export-executable-symbols`
|
// on windows, we need the nightly toolchain so we can use `-Z export-executable-symbols`
|
||||||
// using `+nightly` only works when running cargo through rustup
|
// using `+nightly` only works when running cargo through rustup
|
||||||
let mut cmd = rustup();
|
let mut cmd = rustup();
|
||||||
cmd.args(["run", "nightly-2022-09-17", "cargo"]);
|
cmd.args(["run", "nightly-2022-10-30", "cargo"]);
|
||||||
|
|
||||||
cmd
|
cmd
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1142,7 +1142,7 @@ fn can_extension_type(
|
||||||
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<'_>>>,
|
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 {
|
||||||
|
@ -1454,7 +1454,7 @@ fn can_assigned_fields<'a>(
|
||||||
fn can_assigned_tuple_elems(
|
fn can_assigned_tuple_elems(
|
||||||
env: &mut Env,
|
env: &mut Env,
|
||||||
pol: CanPolarity,
|
pol: CanPolarity,
|
||||||
elems: &&[Loc<TypeAnnotation<'_>>],
|
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,
|
||||||
|
|
|
@ -1338,7 +1338,7 @@ 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(
|
fn resolve_abilities(
|
||||||
env: &mut Env<'_>,
|
env: &mut Env,
|
||||||
output: &mut Output,
|
output: &mut Output,
|
||||||
var_store: &mut VarStore,
|
var_store: &mut VarStore,
|
||||||
scope: &mut Scope,
|
scope: &mut Scope,
|
||||||
|
@ -2812,7 +2812,7 @@ fn to_pending_value_def<'a>(
|
||||||
|
|
||||||
/// Make aliases recursive
|
/// Make aliases recursive
|
||||||
fn correct_mutual_recursive_type_alias(
|
fn correct_mutual_recursive_type_alias(
|
||||||
env: &mut Env<'_>,
|
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> {
|
||||||
|
@ -3021,7 +3021,7 @@ fn correct_mutual_recursive_type_alias(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_tag_union_of_alias_recursive(
|
fn make_tag_union_of_alias_recursive(
|
||||||
env: &mut Env<'_>,
|
env: &mut Env,
|
||||||
alias_name: Symbol,
|
alias_name: Symbol,
|
||||||
alias: &mut Alias,
|
alias: &mut Alias,
|
||||||
others: Vec<Symbol>,
|
others: Vec<Symbol>,
|
||||||
|
@ -3214,7 +3214,7 @@ fn make_tag_union_recursive_help<'a, 'b>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mark_cyclic_alias(
|
fn mark_cyclic_alias(
|
||||||
env: &mut Env<'_>,
|
env: &mut Env,
|
||||||
typ: &mut Type,
|
typ: &mut Type,
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
alias_kind: AliasKind,
|
alias_kind: AliasKind,
|
||||||
|
|
|
@ -199,7 +199,7 @@ impl GeneratedInfo {
|
||||||
env: &mut Env,
|
env: &mut Env,
|
||||||
scope: &mut Scope,
|
scope: &mut Scope,
|
||||||
var_store: &mut VarStore,
|
var_store: &mut VarStore,
|
||||||
header_type: &HeaderType<'_>,
|
header_type: &HeaderType,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
match header_type {
|
match header_type {
|
||||||
HeaderType::Hosted {
|
HeaderType::Hosted {
|
||||||
|
|
|
@ -322,7 +322,7 @@ pub fn canonicalize_def_header_pattern<'a>(
|
||||||
pub struct PermitShadows(pub bool);
|
pub struct PermitShadows(pub bool);
|
||||||
|
|
||||||
fn canonicalize_pattern_symbol(
|
fn canonicalize_pattern_symbol(
|
||||||
env: &mut Env<'_>,
|
env: &mut Env,
|
||||||
scope: &mut Scope,
|
scope: &mut Scope,
|
||||||
output: &mut Output,
|
output: &mut Output,
|
||||||
region: Region,
|
region: Region,
|
||||||
|
|
|
@ -65,15 +65,9 @@ impl Newlines {
|
||||||
pub trait Formattable {
|
pub trait Formattable {
|
||||||
fn is_multiline(&self) -> bool;
|
fn is_multiline(&self) -> bool;
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, _parens: Parens, _newlines: Newlines, indent: u16);
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
_parens: Parens,
|
|
||||||
_newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
);
|
|
||||||
|
|
||||||
fn format(&self, buf: &mut 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,17 +81,11 @@ where
|
||||||
(*self).is_multiline()
|
(*self).is_multiline()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
(*self).format_with_options(buf, parens, newlines, indent)
|
(*self).format_with_options(buf, parens, newlines, indent)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format(&self, buf: &mut Buf<'_>, indent: u16) {
|
fn format(&self, buf: &mut Buf, indent: u16) {
|
||||||
(*self).format(buf, indent)
|
(*self).format(buf, indent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,18 +108,12 @@ where
|
||||||
self.value.is_multiline()
|
self.value.is_multiline()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
self.value
|
self.value
|
||||||
.format_with_options(buf, parens, newlines, indent)
|
.format_with_options(buf, parens, newlines, indent)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format(&self, buf: &mut Buf<'_>, indent: u16) {
|
fn format(&self, buf: &mut Buf, indent: u16) {
|
||||||
self.value.format(buf, indent)
|
self.value.format(buf, indent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +125,7 @@ impl<'a> Formattable for UppercaseIdent<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
_indent: u16,
|
_indent: u16,
|
||||||
|
@ -206,13 +188,7 @@ impl<'a> Formattable for TypeAnnotation<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
use roc_parse::ast::TypeAnnotation::*;
|
use roc_parse::ast::TypeAnnotation::*;
|
||||||
|
|
||||||
let self_is_multiline = self.is_multiline();
|
let self_is_multiline = self.is_multiline();
|
||||||
|
@ -424,13 +400,7 @@ impl<'a> Formattable for AssignedField<'a, TypeAnnotation<'a>> {
|
||||||
is_multiline_assigned_field_help(self)
|
is_multiline_assigned_field_help(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, _parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
_parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
// we abuse the `Newlines` type to decide between multiline or single-line layout
|
// we abuse the `Newlines` type to decide between multiline or single-line layout
|
||||||
format_assigned_field_help(self, buf, indent, 1, newlines == Newlines::Yes);
|
format_assigned_field_help(self, buf, indent, 1, newlines == Newlines::Yes);
|
||||||
}
|
}
|
||||||
|
@ -441,13 +411,7 @@ impl<'a> Formattable for AssignedField<'a, Expr<'a>> {
|
||||||
is_multiline_assigned_field_help(self)
|
is_multiline_assigned_field_help(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, _parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
_parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
// we abuse the `Newlines` type to decide between multiline or single-line layout
|
// we abuse the `Newlines` type to decide between multiline or single-line layout
|
||||||
format_assigned_field_help(self, buf, indent, 0, newlines == Newlines::Yes);
|
format_assigned_field_help(self, buf, indent, 0, newlines == Newlines::Yes);
|
||||||
}
|
}
|
||||||
|
@ -467,8 +431,8 @@ fn is_multiline_assigned_field_help<T: Formattable>(afield: &AssignedField<'_, T
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_assigned_field_help<T>(
|
fn format_assigned_field_help<T>(
|
||||||
zelf: &AssignedField<'_, T>,
|
zelf: &AssignedField<T>,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
separator_spaces: usize,
|
separator_spaces: usize,
|
||||||
is_multiline: bool,
|
is_multiline: bool,
|
||||||
|
@ -547,7 +511,7 @@ impl<'a> Formattable for Tag<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -592,13 +556,7 @@ impl<'a> Formattable for HasClause<'a> {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
buf.push_str(self.var.value.extract_spaces().item);
|
buf.push_str(self.var.value.extract_spaces().item);
|
||||||
buf.spaces(1);
|
buf.spaces(1);
|
||||||
buf.push_str("has");
|
buf.push_str("has");
|
||||||
|
@ -623,13 +581,7 @@ impl<'a> Formattable for HasImpls<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
match self {
|
match self {
|
||||||
HasImpls::HasImpls(impls) => {
|
HasImpls::HasImpls(impls) => {
|
||||||
if newlines == Newlines::Yes {
|
if newlines == Newlines::Yes {
|
||||||
|
@ -662,13 +614,7 @@ impl<'a> Formattable for HasAbility<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
match self {
|
match self {
|
||||||
HasAbility::HasAbility { ability, impls } => {
|
HasAbility::HasAbility { ability, impls } => {
|
||||||
if newlines == Newlines::Yes {
|
if newlines == Newlines::Yes {
|
||||||
|
@ -703,13 +649,7 @@ impl<'a> Formattable for HasAbilities<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
match self {
|
match self {
|
||||||
HasAbilities::Has(has_abilities) => {
|
HasAbilities::Has(has_abilities) => {
|
||||||
if newlines == Newlines::Yes {
|
if newlines == Newlines::Yes {
|
||||||
|
|
|
@ -17,7 +17,7 @@ impl<'a> Formattable for Defs<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -57,13 +57,7 @@ impl<'a> Formattable for TypeDef<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, _parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
_parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
use roc_parse::ast::TypeDef::*;
|
use roc_parse::ast::TypeDef::*;
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
|
@ -173,7 +167,7 @@ impl<'a> Formattable for TypeHeader<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -205,13 +199,7 @@ impl<'a> Formattable for ValueDef<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, _parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
_parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
use roc_parse::ast::ValueDef::*;
|
use roc_parse::ast::ValueDef::*;
|
||||||
match self {
|
match self {
|
||||||
Annotation(loc_pattern, loc_annotation) => {
|
Annotation(loc_pattern, loc_annotation) => {
|
||||||
|
@ -315,7 +303,7 @@ fn should_outdent(mut rhs: &TypeAnnotation) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_dbg_in_def<'a>(
|
fn fmt_dbg_in_def<'a>(
|
||||||
buf: &mut 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,12 +323,7 @@ fn fmt_dbg_in_def<'a>(
|
||||||
condition.format(buf, return_indent);
|
condition.format(buf, return_indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_expect<'a>(
|
fn fmt_expect<'a>(buf: &mut Buf, condition: &'a Loc<Expr<'a>>, is_multiline: bool, indent: u16) {
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
condition: &'a Loc<Expr<'a>>,
|
|
||||||
is_multiline: bool,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
buf.ensure_ends_with_newline();
|
buf.ensure_ends_with_newline();
|
||||||
buf.indent(indent);
|
buf.indent(indent);
|
||||||
buf.push_str("expect");
|
buf.push_str("expect");
|
||||||
|
@ -356,12 +339,7 @@ fn fmt_expect<'a>(
|
||||||
condition.format(buf, return_indent);
|
condition.format(buf, return_indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_expect_fx<'a>(
|
fn fmt_expect_fx<'a>(buf: &mut Buf, condition: &'a Loc<Expr<'a>>, is_multiline: bool, indent: u16) {
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
condition: &'a Loc<Expr<'a>>,
|
|
||||||
is_multiline: bool,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
buf.ensure_ends_with_newline();
|
buf.ensure_ends_with_newline();
|
||||||
buf.indent(indent);
|
buf.indent(indent);
|
||||||
buf.push_str("expect-fx");
|
buf.push_str("expect-fx");
|
||||||
|
@ -377,19 +355,19 @@ fn fmt_expect_fx<'a>(
|
||||||
condition.format(buf, return_indent);
|
condition.format(buf, return_indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fmt_value_def(buf: &mut Buf<'_>, def: &roc_parse::ast::ValueDef<'_>, indent: u16) {
|
pub fn fmt_value_def(buf: &mut Buf, def: &roc_parse::ast::ValueDef, indent: u16) {
|
||||||
def.format(buf, indent);
|
def.format(buf, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fmt_type_def(buf: &mut Buf<'_>, def: &roc_parse::ast::TypeDef<'_>, 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(buf: &mut Buf<'_>, defs: &Defs<'_>, 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: &mut Buf<'_>, pattern: &'a Pattern<'a>, body: &'a Expr<'a>, indent: u16) {
|
pub fn fmt_body<'a>(buf: &mut 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(" =");
|
||||||
|
@ -455,7 +433,7 @@ impl<'a> Formattable for AbilityMember<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
|
|
@ -103,13 +103,7 @@ impl<'a> Formattable for Expr<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
use self::Expr::*;
|
use self::Expr::*;
|
||||||
|
|
||||||
let apply_needs_parens = parens == Parens::InApply;
|
let apply_needs_parens = parens == Parens::InApply;
|
||||||
|
@ -551,7 +545,7 @@ fn starts_with_newline(expr: &Expr) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_str_segment(seg: &StrSegment<'_>, buf: &mut Buf<'_>, indent: u16) {
|
fn format_str_segment(seg: &StrSegment, buf: &mut Buf, indent: u16) {
|
||||||
use StrSegment::*;
|
use StrSegment::*;
|
||||||
|
|
||||||
match seg {
|
match seg {
|
||||||
|
@ -614,7 +608,7 @@ fn push_op(buf: &mut Buf, op: BinOp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fmt_str_literal(buf: &mut 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 {
|
||||||
|
@ -674,7 +668,7 @@ pub fn fmt_str_literal(buf: &mut Buf<'_>, literal: StrLiteral, indent: u16) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_binops<'a>(
|
fn fmt_binops<'a>(
|
||||||
buf: &mut 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,12 +698,7 @@ fn fmt_binops<'a>(
|
||||||
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(
|
fn format_spaces(buf: &mut Buf, spaces: &[CommentOrNewline], newlines: Newlines, indent: u16) {
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
spaces: &[CommentOrNewline<'_>],
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
match newlines {
|
match newlines {
|
||||||
Newlines::Yes => {
|
Newlines::Yes => {
|
||||||
fmt_spaces(buf, spaces.iter(), indent);
|
fmt_spaces(buf, spaces.iter(), indent);
|
||||||
|
@ -739,7 +728,7 @@ fn is_when_patterns_multiline(when_branch: &WhenBranch) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_when<'a>(
|
fn fmt_when<'a>(
|
||||||
buf: &mut 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,
|
||||||
|
@ -921,7 +910,7 @@ fn fmt_when<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_dbg<'a>(
|
fn fmt_dbg<'a>(
|
||||||
buf: &mut 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,
|
||||||
|
@ -948,7 +937,7 @@ fn fmt_dbg<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_expect<'a>(
|
fn fmt_expect<'a>(
|
||||||
buf: &mut 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,
|
||||||
|
@ -975,7 +964,7 @@ fn fmt_expect<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_if<'a>(
|
fn fmt_if<'a>(
|
||||||
buf: &mut 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,
|
||||||
|
@ -1124,7 +1113,7 @@ fn fmt_if<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_closure<'a>(
|
fn fmt_closure<'a>(
|
||||||
buf: &mut 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,
|
||||||
|
@ -1225,7 +1214,7 @@ fn fmt_closure<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_backpassing<'a>(
|
fn fmt_backpassing<'a>(
|
||||||
buf: &mut 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>>,
|
||||||
|
@ -1313,7 +1302,7 @@ fn pattern_needs_parens_when_backpassing(pat: &Pattern) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_record<'a>(
|
fn fmt_record<'a>(
|
||||||
buf: &mut 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,
|
||||||
|
@ -1405,8 +1394,8 @@ fn fmt_record<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_field_multiline<T>(
|
fn format_field_multiline<T>(
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
field: &AssignedField<'_, T>,
|
field: &AssignedField<T>,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
separator_prefix: &str,
|
separator_prefix: &str,
|
||||||
) where
|
) where
|
||||||
|
|
|
@ -88,7 +88,7 @@ impl<V: Formattable> Formattable for Option<V> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
parens: crate::annotation::Parens,
|
parens: crate::annotation::Parens,
|
||||||
newlines: Newlines,
|
newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -113,7 +113,7 @@ impl<'a> Formattable for ProvidesTo<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: crate::annotation::Parens,
|
_parens: crate::annotation::Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -132,7 +132,7 @@ impl<'a> Formattable for PlatformRequires<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: crate::annotation::Parens,
|
_parens: crate::annotation::Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -148,7 +148,7 @@ impl<'a, V: Formattable> Formattable for Spaces<'a, V> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
parens: crate::annotation::Parens,
|
parens: crate::annotation::Parens,
|
||||||
newlines: Newlines,
|
newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -164,20 +164,14 @@ 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(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
self.keyword
|
self.keyword
|
||||||
.format_with_options(buf, parens, newlines, indent);
|
.format_with_options(buf, parens, newlines, indent);
|
||||||
self.item.format_with_options(buf, parens, newlines, indent);
|
self.item.format_with_options(buf, parens, newlines, indent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fmt_interface_header<'a>(buf: &mut 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 +187,7 @@ pub fn fmt_interface_header<'a>(buf: &mut Buf<'_>, header: &'a InterfaceHeader<'
|
||||||
fmt_imports(buf, header.imports.item, indent);
|
fmt_imports(buf, header.imports.item, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fmt_hosted_header<'a>(buf: &mut 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 +204,7 @@ pub fn fmt_hosted_header<'a>(buf: &mut Buf<'_>, header: &'a HostedHeader<'a>) {
|
||||||
fmt_exposes(buf, header.generates_with.item, indent);
|
fmt_exposes(buf, header.generates_with.item, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fmt_app_header<'a>(buf: &mut 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 +223,7 @@ pub fn fmt_app_header<'a>(buf: &mut Buf<'_>, header: &'a AppHeader<'a>) {
|
||||||
header.provides.format(buf, indent);
|
header.provides.format(buf, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fmt_package_header<'a>(buf: &mut 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 +237,7 @@ pub fn fmt_package_header<'a>(buf: &mut Buf<'_>, header: &'a PackageHeader<'a>)
|
||||||
fmt_packages(buf, header.packages.item, indent);
|
fmt_packages(buf, header.packages.item, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fmt_platform_header<'a>(buf: &mut 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 +256,7 @@ pub fn fmt_platform_header<'a>(buf: &mut Buf<'_>, header: &'a PlatformHeader<'a>
|
||||||
fmt_provides(buf, header.provides.item, None, indent);
|
fmt_provides(buf, header.provides.item, None, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_requires(buf: &mut Buf<'_>, requires: &PlatformRequires<'_>, 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(" {");
|
||||||
|
@ -278,7 +272,7 @@ impl<'a> Formattable for TypedIdent<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -293,7 +287,7 @@ impl<'a> Formattable for TypedIdent<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_package_name(buf: &mut 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());
|
||||||
|
@ -314,7 +308,7 @@ impl<'a, T: Formattable> Formattable for Spaced<'a, T> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
parens: crate::annotation::Parens,
|
parens: crate::annotation::Parens,
|
||||||
newlines: Newlines,
|
newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -336,7 +330,7 @@ impl<'a, T: Formattable> Formattable for Spaced<'a, T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_imports<'a>(
|
fn fmt_imports<'a>(
|
||||||
buf: &mut 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,
|
||||||
) {
|
) {
|
||||||
|
@ -344,7 +338,7 @@ fn fmt_imports<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_provides<'a>(
|
fn fmt_provides<'a>(
|
||||||
buf: &mut 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 +350,7 @@ fn fmt_provides<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_to(buf: &mut 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);
|
||||||
|
@ -366,7 +360,7 @@ fn fmt_to(buf: &mut Buf<'_>, to: To, indent: u16) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_exposes<N: Formattable + Copy + core::fmt::Debug>(
|
fn fmt_exposes<N: Formattable + Copy + core::fmt::Debug>(
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
loc_entries: Collection<'_, Loc<Spaced<'_, N>>>,
|
loc_entries: Collection<'_, Loc<Spaced<'_, N>>>,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
) {
|
) {
|
||||||
|
@ -374,17 +368,17 @@ fn fmt_exposes<N: Formattable + Copy + core::fmt::Debug>(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait FormatName {
|
pub trait FormatName {
|
||||||
fn format(&self, buf: &mut Buf<'_>);
|
fn format(&self, buf: &mut Buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> FormatName for &'a str {
|
impl<'a> FormatName for &'a str {
|
||||||
fn format(&self, buf: &mut 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(&self, buf: &mut Buf<'_>) {
|
fn format(&self, buf: &mut Buf) {
|
||||||
buf.push_str(self.as_str());
|
buf.push_str(self.as_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -396,7 +390,7 @@ impl<'a> Formattable for ModuleName<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
_indent: u16,
|
_indent: u16,
|
||||||
|
@ -412,7 +406,7 @@ impl<'a> Formattable for ExposedName<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -423,13 +417,13 @@ impl<'a> Formattable for ExposedName<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> FormatName for ExposedName<'a> {
|
impl<'a> FormatName for ExposedName<'a> {
|
||||||
fn format(&self, buf: &mut Buf<'_>) {
|
fn format(&self, buf: &mut Buf) {
|
||||||
buf.push_str(self.as_str());
|
buf.push_str(self.as_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_packages<'a>(
|
fn fmt_packages<'a>(
|
||||||
buf: &mut 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,
|
||||||
) {
|
) {
|
||||||
|
@ -443,7 +437,7 @@ impl<'a> Formattable for PackageEntry<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -459,7 +453,7 @@ impl<'a> Formattable for ImportsEntry<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -467,14 +461,14 @@ impl<'a> Formattable for ImportsEntry<'a> {
|
||||||
fmt_imports_entry(buf, self, indent);
|
fmt_imports_entry(buf, self, indent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn fmt_packages_entry(buf: &mut Buf<'_>, entry: &PackageEntry<'_>, 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(buf: &mut Buf<'_>, entry: &ImportsEntry<'_>, 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);
|
||||||
|
|
|
@ -4,7 +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: &mut Buf<'_>, pattern: &'a Pattern<'a>, indent: u16, parens: Parens) {
|
pub fn fmt_pattern<'a>(buf: &mut 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ impl<'a> Formattable for PatternAs<'a> {
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(
|
||||||
&self,
|
&self,
|
||||||
buf: &mut Buf<'_>,
|
buf: &mut Buf,
|
||||||
_parens: Parens,
|
_parens: Parens,
|
||||||
_newlines: Newlines,
|
_newlines: Newlines,
|
||||||
indent: u16,
|
indent: u16,
|
||||||
|
@ -80,13 +80,7 @@ impl<'a> Formattable for Pattern<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn format_with_options(
|
fn format_with_options(&self, buf: &mut Buf, parens: Parens, newlines: Newlines, indent: u16) {
|
||||||
&self,
|
|
||||||
buf: &mut Buf<'_>,
|
|
||||||
parens: Parens,
|
|
||||||
newlines: Newlines,
|
|
||||||
indent: u16,
|
|
||||||
) {
|
|
||||||
use self::Pattern::*;
|
use self::Pattern::*;
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
|
|
|
@ -21,14 +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(buf: &mut Buf<'_>, spaces: &[CommentOrNewline<'_>], indent: u16) {
|
pub fn fmt_default_spaces(buf: &mut Buf, spaces: &[CommentOrNewline], 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(buf: &mut Buf<'_>, spaces: &[CommentOrNewline<'_>], indent: u16) {
|
pub fn fmt_default_newline(buf: &mut Buf, spaces: &[CommentOrNewline], indent: u16) {
|
||||||
if spaces.is_empty() {
|
if spaces.is_empty() {
|
||||||
buf.newline();
|
buf.newline();
|
||||||
} else {
|
} else {
|
||||||
|
@ -145,7 +145,7 @@ pub fn fmt_comments_only<'a, 'buf, I>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_comment(buf: &mut 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() {
|
||||||
|
@ -184,7 +184,7 @@ where
|
||||||
count
|
count
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fmt_docs(buf: &mut 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() {
|
||||||
|
|
|
@ -1766,9 +1766,9 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn shift_reg64_reg64_reg64<'a, 'r, ASM, CC>(
|
fn shift_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>,
|
||||||
shift_function: fn(buf: &mut Vec<'_, u8>, X86_64GeneralReg),
|
shift_function: fn(buf: &mut Vec<'_, u8>, X86_64GeneralReg),
|
||||||
dst: X86_64GeneralReg,
|
dst: X86_64GeneralReg,
|
||||||
src1: X86_64GeneralReg,
|
src1: X86_64GeneralReg,
|
||||||
|
|
|
@ -24,8 +24,8 @@ use roc_mono::layout::{
|
||||||
use super::build::{create_entry_block_alloca, BuilderExt};
|
use super::build::{create_entry_block_alloca, BuilderExt};
|
||||||
use super::convert::zig_list_type;
|
use super::convert::zig_list_type;
|
||||||
|
|
||||||
pub fn call_bitcode_fn<'a, 'ctx, 'env>(
|
pub fn call_bitcode_fn<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
args: &[BasicValueEnum<'ctx>],
|
args: &[BasicValueEnum<'ctx>],
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -40,8 +40,8 @@ pub fn call_bitcode_fn<'a, 'ctx, 'env>(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn call_void_bitcode_fn<'a, 'ctx, 'env>(
|
pub fn call_void_bitcode_fn<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
args: &[BasicValueEnum<'ctx>],
|
args: &[BasicValueEnum<'ctx>],
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
) -> InstructionValue<'ctx> {
|
) -> InstructionValue<'ctx> {
|
||||||
|
@ -51,8 +51,8 @@ pub fn call_void_bitcode_fn<'a, 'ctx, 'env>(
|
||||||
.unwrap_or_else(|| panic!("LLVM error: Tried to call void bitcode function, but got return value from bitcode function, {:?}", fn_name))
|
.unwrap_or_else(|| panic!("LLVM error: Tried to call void bitcode function, but got return value from bitcode function, {:?}", fn_name))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call_bitcode_fn_help<'a, 'ctx, 'env>(
|
fn call_bitcode_fn_help<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
args: &[BasicValueEnum<'ctx>],
|
args: &[BasicValueEnum<'ctx>],
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
) -> CallSiteValue<'ctx> {
|
) -> CallSiteValue<'ctx> {
|
||||||
|
@ -165,8 +165,8 @@ const ARGUMENT_SYMBOLS: [Symbol; 8] = [
|
||||||
Symbol::ARG_8,
|
Symbol::ARG_8,
|
||||||
];
|
];
|
||||||
|
|
||||||
pub(crate) fn build_transform_caller<'a, 'ctx, 'env>(
|
pub(crate) fn build_transform_caller<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
function: FunctionValue<'ctx>,
|
function: FunctionValue<'ctx>,
|
||||||
closure_data_layout: LambdaSet<'a>,
|
closure_data_layout: LambdaSet<'a>,
|
||||||
|
@ -192,8 +192,8 @@ pub(crate) fn build_transform_caller<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_transform_caller_help<'a, 'ctx, 'env>(
|
fn build_transform_caller_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
closure_data_layout: LambdaSet<'a>,
|
closure_data_layout: LambdaSet<'a>,
|
||||||
|
@ -322,8 +322,8 @@ enum Mode {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// a function that accepts two arguments: the value to increment, and an amount to increment by
|
/// a function that accepts two arguments: the value to increment, and an amount to increment by
|
||||||
pub fn build_inc_n_wrapper<'a, 'ctx, 'env>(
|
pub fn build_inc_n_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
|
@ -332,8 +332,8 @@ pub fn build_inc_n_wrapper<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// a function that accepts two arguments: the value to increment; increments by 1
|
/// a function that accepts two arguments: the value to increment; increments by 1
|
||||||
pub fn build_inc_wrapper<'a, 'ctx, 'env>(
|
pub fn build_inc_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
|
@ -341,8 +341,8 @@ pub fn build_inc_wrapper<'a, 'ctx, 'env>(
|
||||||
build_rc_wrapper(env, layout_interner, layout_ids, layout, Mode::Inc)
|
build_rc_wrapper(env, layout_interner, layout_ids, layout, Mode::Inc)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_dec_wrapper<'a, 'ctx, 'env>(
|
pub fn build_dec_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
|
@ -350,8 +350,8 @@ pub fn build_dec_wrapper<'a, 'ctx, 'env>(
|
||||||
build_rc_wrapper(env, layout_interner, layout_ids, layout, Mode::Dec)
|
build_rc_wrapper(env, layout_interner, layout_ids, layout, Mode::Dec)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_rc_wrapper<'a, 'ctx, 'env>(
|
fn build_rc_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
|
@ -453,8 +453,8 @@ fn build_rc_wrapper<'a, 'ctx, 'env>(
|
||||||
function_value
|
function_value
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_eq_wrapper<'a, 'ctx, 'env>(
|
pub fn build_eq_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
|
@ -536,8 +536,8 @@ pub fn build_eq_wrapper<'a, 'ctx, 'env>(
|
||||||
function_value
|
function_value
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_compare_wrapper<'a, 'ctx, 'env>(
|
pub fn build_compare_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
|
@ -705,9 +705,9 @@ impl BitcodeReturns {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn return_value_64bit<'a, 'ctx, 'env>(
|
fn return_value_64bit<'a, 'ctx>(
|
||||||
&self,
|
&self,
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
arguments: &mut bumpalo::collections::Vec<'a, BasicValueEnum<'ctx>>,
|
arguments: &mut bumpalo::collections::Vec<'a, BasicValueEnum<'ctx>>,
|
||||||
) -> BitcodeReturnValue<'ctx> {
|
) -> BitcodeReturnValue<'ctx> {
|
||||||
match self {
|
match self {
|
||||||
|
@ -746,9 +746,9 @@ impl BitcodeReturns {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call_and_load_32bit<'a, 'ctx, 'env>(
|
fn call_and_load_32bit<'ctx>(
|
||||||
&self,
|
&self,
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
arguments: &[BasicValueEnum<'ctx>],
|
arguments: &[BasicValueEnum<'ctx>],
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -764,8 +764,8 @@ impl BitcodeReturns {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ptr_len_cap<'a, 'ctx, 'env>(
|
fn ptr_len_cap<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
value: StructValue<'ctx>,
|
value: StructValue<'ctx>,
|
||||||
) -> (PointerValue<'ctx>, IntValue<'ctx>, IntValue<'ctx>) {
|
) -> (PointerValue<'ctx>, IntValue<'ctx>, IntValue<'ctx>) {
|
||||||
let ptr_and_len = env
|
let ptr_and_len = env
|
||||||
|
@ -808,8 +808,8 @@ fn ptr_len_cap<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts the { i64, i32 } struct that zig returns into `list.RocList = type { i8*, i32, i32 }`
|
/// Converts the { i64, i32 } struct that zig returns into `list.RocList = type { i8*, i32, i32 }`
|
||||||
fn receive_zig_roc_list_32bit<'a, 'ctx, 'env>(
|
fn receive_zig_roc_list_32bit<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
value: StructValue<'ctx>,
|
value: StructValue<'ctx>,
|
||||||
) -> StructValue<'ctx> {
|
) -> StructValue<'ctx> {
|
||||||
let list_type = super::convert::zig_list_type(env);
|
let list_type = super::convert::zig_list_type(env);
|
||||||
|
@ -824,8 +824,8 @@ fn receive_zig_roc_list_32bit<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts the { i64, i32 } struct that zig returns into `list.RocList = type { i8*, i32, i32 }`
|
/// Converts the { i64, i32 } struct that zig returns into `list.RocList = type { i8*, i32, i32 }`
|
||||||
fn receive_zig_roc_str_32bit<'a, 'ctx, 'env>(
|
fn receive_zig_roc_str_32bit<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
value: StructValue<'ctx>,
|
value: StructValue<'ctx>,
|
||||||
) -> StructValue<'ctx> {
|
) -> StructValue<'ctx> {
|
||||||
let str_type = super::convert::zig_str_type(env);
|
let str_type = super::convert::zig_str_type(env);
|
||||||
|
@ -839,8 +839,8 @@ fn receive_zig_roc_str_32bit<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn pass_list_to_zig_64bit<'a, 'ctx, 'env>(
|
pub(crate) fn pass_list_to_zig_64bit<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
list: BasicValueEnum<'ctx>,
|
list: BasicValueEnum<'ctx>,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
let parent = env
|
let parent = env
|
||||||
|
@ -857,16 +857,16 @@ pub(crate) fn pass_list_to_zig_64bit<'a, 'ctx, 'env>(
|
||||||
list_alloca
|
list_alloca
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pass_string_to_zig_64bit<'a, 'ctx, 'env>(
|
fn pass_string_to_zig_64bit<'ctx>(
|
||||||
_env: &Env<'a, 'ctx, 'env>,
|
_env: &Env<'_, 'ctx, '_>,
|
||||||
string: BasicValueEnum<'ctx>,
|
string: BasicValueEnum<'ctx>,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
// we must pass strings by-pointer, and that is already how they are stored
|
// we must pass strings by-pointer, and that is already how they are stored
|
||||||
string.into_pointer_value()
|
string.into_pointer_value()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn pass_list_or_string_to_zig_32bit<'a, 'ctx, 'env>(
|
pub(crate) fn pass_list_or_string_to_zig_32bit<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
list_or_string: StructValue<'ctx>,
|
list_or_string: StructValue<'ctx>,
|
||||||
) -> (IntValue<'ctx>, IntValue<'ctx>) {
|
) -> (IntValue<'ctx>, IntValue<'ctx>) {
|
||||||
let ptr = env
|
let ptr = env
|
||||||
|
@ -907,8 +907,8 @@ pub(crate) fn pass_list_or_string_to_zig_32bit<'a, 'ctx, 'env>(
|
||||||
(ptr_len, cap)
|
(ptr_len, cap)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn call_str_bitcode_fn<'a, 'ctx, 'env>(
|
pub(crate) fn call_str_bitcode_fn<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
strings: &[BasicValueEnum<'ctx>],
|
strings: &[BasicValueEnum<'ctx>],
|
||||||
other_arguments: &[BasicValueEnum<'ctx>],
|
other_arguments: &[BasicValueEnum<'ctx>],
|
||||||
returns: BitcodeReturns,
|
returns: BitcodeReturns,
|
||||||
|
@ -948,8 +948,8 @@ pub(crate) fn call_str_bitcode_fn<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn call_list_bitcode_fn<'a, 'ctx, 'env>(
|
pub(crate) fn call_list_bitcode_fn<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
lists: &[StructValue<'ctx>],
|
lists: &[StructValue<'ctx>],
|
||||||
other_arguments: &[BasicValueEnum<'ctx>],
|
other_arguments: &[BasicValueEnum<'ctx>],
|
||||||
returns: BitcodeReturns,
|
returns: BitcodeReturns,
|
||||||
|
|
|
@ -614,8 +614,8 @@ pub fn construct_optimization_passes<'a>(
|
||||||
(mpm, fpm)
|
(mpm, fpm)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn promote_to_main_function<'a, 'ctx, 'env>(
|
fn promote_to_main_function<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
mod_solutions: &'a ModSolutions,
|
mod_solutions: &'a ModSolutions,
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
|
@ -653,8 +653,8 @@ fn promote_to_main_function<'a, 'ctx, 'env>(
|
||||||
(main_fn_name, main_fn)
|
(main_fn_name, main_fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn promote_to_wasm_test_wrapper<'a, 'ctx, 'env>(
|
fn promote_to_wasm_test_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
mod_solutions: &'a ModSolutions,
|
mod_solutions: &'a ModSolutions,
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
|
@ -746,8 +746,8 @@ fn promote_to_wasm_test_wrapper<'a, 'ctx, 'env>(
|
||||||
(main_fn_name, main_fn)
|
(main_fn_name, main_fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn int_with_precision<'a, 'ctx, 'env>(
|
fn int_with_precision<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
value: i128,
|
value: i128,
|
||||||
int_width: IntWidth,
|
int_width: IntWidth,
|
||||||
) -> IntValue<'ctx> {
|
) -> IntValue<'ctx> {
|
||||||
|
@ -762,8 +762,8 @@ fn int_with_precision<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn float_with_precision<'a, 'ctx, 'env>(
|
fn float_with_precision<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
value: f64,
|
value: f64,
|
||||||
float_width: FloatWidth,
|
float_width: FloatWidth,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -773,8 +773,8 @@ fn float_with_precision<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_exp_literal<'a, 'ctx, 'env>(
|
pub fn build_exp_literal<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &STLayoutInterner<'a>,
|
layout_interner: &STLayoutInterner<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
layout: InLayout<'_>,
|
layout: InLayout<'_>,
|
||||||
|
@ -817,8 +817,8 @@ pub fn build_exp_literal<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_string_literal<'a, 'ctx, 'env>(
|
fn build_string_literal<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
str_literal: &str,
|
str_literal: &str,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -844,8 +844,8 @@ fn build_string_literal<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn const_str_alloca_ptr<'a, 'ctx, 'env>(
|
fn const_str_alloca_ptr<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
len: IntValue<'ctx>,
|
len: IntValue<'ctx>,
|
||||||
|
@ -862,8 +862,8 @@ fn const_str_alloca_ptr<'a, 'ctx, 'env>(
|
||||||
alloca
|
alloca
|
||||||
}
|
}
|
||||||
|
|
||||||
fn small_str_ptr_width_8<'a, 'ctx, 'env>(
|
fn small_str_ptr_width_8<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
str_literal: &str,
|
str_literal: &str,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
|
@ -890,10 +890,7 @@ fn small_str_ptr_width_8<'a, 'ctx, 'env>(
|
||||||
const_str_alloca_ptr(env, parent, ptr, len, cap)
|
const_str_alloca_ptr(env, parent, ptr, len, cap)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn small_str_ptr_width_4<'a, 'ctx, 'env>(
|
fn small_str_ptr_width_4<'ctx>(env: &Env<'_, 'ctx, '_>, str_literal: &str) -> StructValue<'ctx> {
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
|
||||||
str_literal: &str,
|
|
||||||
) -> StructValue<'ctx> {
|
|
||||||
debug_assert_eq!(env.target_info.ptr_width() as u8, 4);
|
debug_assert_eq!(env.target_info.ptr_width() as u8, 4);
|
||||||
|
|
||||||
let mut array = [0u8; 12];
|
let mut array = [0u8; 12];
|
||||||
|
@ -921,8 +918,8 @@ fn small_str_ptr_width_4<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_exp_call<'a, 'ctx, 'env>(
|
pub fn build_exp_call<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
func_spec_solutions: &FuncSpecSolutions,
|
func_spec_solutions: &FuncSpecSolutions,
|
||||||
|
@ -1068,8 +1065,8 @@ fn struct_pointer_from_fields<'a, 'ctx, 'env, I>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_exp_expr<'a, 'ctx, 'env>(
|
pub fn build_exp_expr<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
func_spec_solutions: &FuncSpecSolutions,
|
func_spec_solutions: &FuncSpecSolutions,
|
||||||
|
@ -1489,8 +1486,8 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_wrapped_tag<'a, 'ctx, 'env>(
|
fn build_wrapped_tag<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
scope: &Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
union_layout: &UnionLayout<'a>,
|
union_layout: &UnionLayout<'a>,
|
||||||
|
@ -1568,8 +1565,8 @@ fn build_wrapped_tag<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn entry_block_alloca_zerofill<'a, 'ctx, 'env>(
|
pub fn entry_block_alloca_zerofill<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
basic_type: BasicTypeEnum<'ctx>,
|
basic_type: BasicTypeEnum<'ctx>,
|
||||||
name: &str,
|
name: &str,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
|
@ -1583,8 +1580,8 @@ pub fn entry_block_alloca_zerofill<'a, 'ctx, 'env>(
|
||||||
create_entry_block_alloca(env, parent, basic_type, name)
|
create_entry_block_alloca(env, parent, basic_type, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_tag_field_value<'a, 'ctx, 'env>(
|
fn build_tag_field_value<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
value: BasicValueEnum<'ctx>,
|
value: BasicValueEnum<'ctx>,
|
||||||
tag_field_layout: InLayout<'a>,
|
tag_field_layout: InLayout<'a>,
|
||||||
|
@ -1643,8 +1640,8 @@ fn build_tag_fields<'a, 'r, 'ctx, 'env>(
|
||||||
(field_types, field_values)
|
(field_types, field_values)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_struct<'a, 'ctx, 'env>(
|
fn build_struct<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
scope: &Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
sorted_fields: &[Symbol],
|
sorted_fields: &[Symbol],
|
||||||
|
@ -1685,8 +1682,8 @@ fn build_struct<'a, 'ctx, 'env>(
|
||||||
struct_from_fields(env, struct_type, field_vals.into_iter().enumerate())
|
struct_from_fields(env, struct_type, field_vals.into_iter().enumerate())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_tag<'a, 'ctx, 'env>(
|
fn build_tag<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
scope: &Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
union_layout: &UnionLayout<'a>,
|
union_layout: &UnionLayout<'a>,
|
||||||
|
@ -1844,8 +1841,8 @@ fn build_tag<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tag_pointer_set_tag_id<'a, 'ctx, 'env>(
|
fn tag_pointer_set_tag_id<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
tag_id: u8,
|
tag_id: u8,
|
||||||
pointer: PointerValue<'ctx>,
|
pointer: PointerValue<'ctx>,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
|
@ -1870,8 +1867,8 @@ pub fn tag_pointer_tag_id_bits_and_mask(target_info: TargetInfo) -> (u64, u64) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn tag_pointer_read_tag_id<'a, 'ctx, 'env>(
|
pub fn tag_pointer_read_tag_id<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
pointer: PointerValue<'ctx>,
|
pointer: PointerValue<'ctx>,
|
||||||
) -> IntValue<'ctx> {
|
) -> IntValue<'ctx> {
|
||||||
let (_, mask) = tag_pointer_tag_id_bits_and_mask(env.target_info);
|
let (_, mask) = tag_pointer_tag_id_bits_and_mask(env.target_info);
|
||||||
|
@ -1886,8 +1883,8 @@ pub fn tag_pointer_read_tag_id<'a, 'ctx, 'env>(
|
||||||
.build_int_cast_sign_flag(masked, env.context.i8_type(), false, "to_u8")
|
.build_int_cast_sign_flag(masked, env.context.i8_type(), false, "to_u8")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn tag_pointer_clear_tag_id<'a, 'ctx, 'env>(
|
pub fn tag_pointer_clear_tag_id<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
pointer: PointerValue<'ctx>,
|
pointer: PointerValue<'ctx>,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
let ptr_int = env.ptr_int();
|
let ptr_int = env.ptr_int();
|
||||||
|
@ -1908,8 +1905,8 @@ pub fn tag_pointer_clear_tag_id<'a, 'ctx, 'env>(
|
||||||
.build_int_to_ptr(masked, pointer.get_type(), "to_ptr")
|
.build_int_to_ptr(masked, pointer.get_type(), "to_ptr")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn allocate_tag<'a, 'ctx, 'env>(
|
fn allocate_tag<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
reuse_allocation: Option<PointerValue<'ctx>>,
|
reuse_allocation: Option<PointerValue<'ctx>>,
|
||||||
|
@ -1968,8 +1965,8 @@ fn allocate_tag<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_tag_id<'a, 'ctx, 'env>(
|
pub fn get_tag_id<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
union_layout: &UnionLayout<'a>,
|
union_layout: &UnionLayout<'a>,
|
||||||
|
@ -2051,8 +2048,8 @@ pub fn get_tag_id<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lookup_at_index_ptr<'a, 'ctx, 'env>(
|
fn lookup_at_index_ptr<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
field_layouts: &[InLayout<'a>],
|
field_layouts: &[InLayout<'a>],
|
||||||
index: usize,
|
index: usize,
|
||||||
|
@ -2086,8 +2083,8 @@ fn lookup_at_index_ptr<'a, 'ctx, 'env>(
|
||||||
cast_if_necessary_for_opaque_recursive_pointers(env.builder, result, target_loaded_type)
|
cast_if_necessary_for_opaque_recursive_pointers(env.builder, result, target_loaded_type)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lookup_at_index_ptr2<'a, 'ctx, 'env>(
|
fn lookup_at_index_ptr2<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
field_layouts: &'a [InLayout<'a>],
|
field_layouts: &'a [InLayout<'a>],
|
||||||
index: usize,
|
index: usize,
|
||||||
|
@ -2129,8 +2126,8 @@ fn lookup_at_index_ptr2<'a, 'ctx, 'env>(
|
||||||
cast_if_necessary_for_opaque_recursive_pointers(env.builder, result, target_loaded_type)
|
cast_if_necessary_for_opaque_recursive_pointers(env.builder, result, target_loaded_type)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn reserve_with_refcount<'a, 'ctx, 'env>(
|
pub fn reserve_with_refcount<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
|
@ -2142,8 +2139,8 @@ pub fn reserve_with_refcount<'a, 'ctx, 'env>(
|
||||||
reserve_with_refcount_help(env, basic_type, stack_size, alignment_bytes)
|
reserve_with_refcount_help(env, basic_type, stack_size, alignment_bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn reserve_with_refcount_union_as_block_of_memory<'a, 'ctx, 'env>(
|
fn reserve_with_refcount_union_as_block_of_memory<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
union_layout: UnionLayout<'a>,
|
union_layout: UnionLayout<'a>,
|
||||||
fields: &[&[InLayout<'a>]],
|
fields: &[&[InLayout<'a>]],
|
||||||
|
@ -2177,8 +2174,8 @@ fn reserve_with_refcount_help<'a, 'ctx, 'env>(
|
||||||
allocate_with_refcount_help(env, basic_type, alignment_bytes, value_bytes_intvalue)
|
allocate_with_refcount_help(env, basic_type, alignment_bytes, value_bytes_intvalue)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn allocate_with_refcount<'a, 'ctx, 'env>(
|
pub fn allocate_with_refcount<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
value: BasicValueEnum<'ctx>,
|
value: BasicValueEnum<'ctx>,
|
||||||
|
@ -2213,8 +2210,8 @@ pub fn allocate_with_refcount_help<'a, 'ctx, 'env>(
|
||||||
.build_pointer_cast(ptr, ptr_type, "alloc_cast_to_desired")
|
.build_pointer_cast(ptr, ptr_type, "alloc_cast_to_desired")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn list_literal<'a, 'ctx, 'env>(
|
fn list_literal<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
scope: &Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
|
@ -2382,8 +2379,8 @@ fn list_literal<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_roc_value<'a, 'ctx, 'env>(
|
pub fn load_roc_value<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
source: PointerValue<'ctx>,
|
source: PointerValue<'ctx>,
|
||||||
|
@ -2402,8 +2399,8 @@ pub fn load_roc_value<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn use_roc_value<'a, 'ctx, 'env>(
|
pub fn use_roc_value<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
source: BasicValueEnum<'ctx>,
|
source: BasicValueEnum<'ctx>,
|
||||||
|
@ -2424,8 +2421,8 @@ pub fn use_roc_value<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn store_roc_value_opaque<'a, 'ctx, 'env>(
|
pub fn store_roc_value_opaque<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
opaque_destination: PointerValue<'ctx>,
|
opaque_destination: PointerValue<'ctx>,
|
||||||
|
@ -2440,8 +2437,8 @@ pub fn store_roc_value_opaque<'a, 'ctx, 'env>(
|
||||||
store_roc_value(env, layout_interner, layout, destination, value)
|
store_roc_value(env, layout_interner, layout, destination, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn store_roc_value<'a, 'ctx, 'env>(
|
pub fn store_roc_value<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
destination: PointerValue<'ctx>,
|
destination: PointerValue<'ctx>,
|
||||||
|
@ -2481,8 +2478,8 @@ pub fn store_roc_value<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_exp_stmt<'a, 'ctx, 'env>(
|
pub fn build_exp_stmt<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
func_spec_solutions: &FuncSpecSolutions,
|
func_spec_solutions: &FuncSpecSolutions,
|
||||||
|
@ -3048,7 +3045,7 @@ pub fn build_exp_stmt<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_symbol<'a, 'ctx>(scope: &Scope<'a, 'ctx>, symbol: &Symbol) -> BasicValueEnum<'ctx> {
|
pub fn load_symbol<'ctx>(scope: &Scope<'_, 'ctx>, symbol: &Symbol) -> BasicValueEnum<'ctx> {
|
||||||
match scope.get(symbol) {
|
match scope.get(symbol) {
|
||||||
Some((_, ptr)) => *ptr,
|
Some((_, ptr)) => *ptr,
|
||||||
|
|
||||||
|
@ -3059,8 +3056,8 @@ pub fn load_symbol<'a, 'ctx>(scope: &Scope<'a, 'ctx>, symbol: &Symbol) -> BasicV
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn load_symbol_and_layout<'a, 'ctx, 'b>(
|
pub(crate) fn load_symbol_and_layout<'a, 'ctx>(
|
||||||
scope: &'b Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
symbol: &Symbol,
|
symbol: &Symbol,
|
||||||
) -> (BasicValueEnum<'ctx>, InLayout<'a>) {
|
) -> (BasicValueEnum<'ctx>, InLayout<'a>) {
|
||||||
match scope.get(symbol) {
|
match scope.get(symbol) {
|
||||||
|
@ -3172,8 +3169,8 @@ pub fn complex_bitcast<'ctx>(
|
||||||
|
|
||||||
/// Check the size of the input and output types. Pretending we have more bytes at a pointer than
|
/// Check the size of the input and output types. Pretending we have more bytes at a pointer than
|
||||||
/// we actually do can lead to faulty optimizations and weird segfaults/crashes
|
/// we actually do can lead to faulty optimizations and weird segfaults/crashes
|
||||||
pub fn complex_bitcast_check_size<'a, 'ctx, 'env>(
|
pub fn complex_bitcast_check_size<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
from_value: BasicValueEnum<'ctx>,
|
from_value: BasicValueEnum<'ctx>,
|
||||||
to_type: BasicTypeEnum<'ctx>,
|
to_type: BasicTypeEnum<'ctx>,
|
||||||
name: &str,
|
name: &str,
|
||||||
|
@ -3284,8 +3281,8 @@ fn complex_bitcast_to_bigger_than_from<'ctx>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// get the tag id out of a pointer to a wrapped (i.e. stores the tag id at runtime) layout
|
/// get the tag id out of a pointer to a wrapped (i.e. stores the tag id at runtime) layout
|
||||||
fn get_tag_id_wrapped<'a, 'ctx, 'env>(
|
fn get_tag_id_wrapped<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
union_layout: UnionLayout<'a>,
|
union_layout: UnionLayout<'a>,
|
||||||
from_value: PointerValue<'ctx>,
|
from_value: PointerValue<'ctx>,
|
||||||
|
@ -3308,8 +3305,8 @@ fn get_tag_id_wrapped<'a, 'ctx, 'env>(
|
||||||
.into_int_value()
|
.into_int_value()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_tag_id_non_recursive<'a, 'ctx, 'env>(
|
pub fn get_tag_id_non_recursive<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
tag: StructValue<'ctx>,
|
tag: StructValue<'ctx>,
|
||||||
) -> IntValue<'ctx> {
|
) -> IntValue<'ctx> {
|
||||||
env.builder
|
env.builder
|
||||||
|
@ -3326,7 +3323,7 @@ struct SwitchArgsIr<'a, 'ctx> {
|
||||||
pub ret_type: BasicTypeEnum<'ctx>,
|
pub ret_type: BasicTypeEnum<'ctx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn const_i128<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>, value: i128) -> IntValue<'ctx> {
|
fn const_i128<'ctx>(env: &Env<'_, 'ctx, '_>, value: i128) -> IntValue<'ctx> {
|
||||||
// truncate the lower 64 bits
|
// truncate the lower 64 bits
|
||||||
let value = value as u128;
|
let value = value as u128;
|
||||||
let a = value as u64;
|
let a = value as u64;
|
||||||
|
@ -3339,9 +3336,9 @@ fn const_i128<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>, value: i128) -> IntValu
|
||||||
.const_int_arbitrary_precision(&[a, b])
|
.const_int_arbitrary_precision(&[a, b])
|
||||||
}
|
}
|
||||||
|
|
||||||
fn const_u128<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>, value: u128) -> IntValue<'ctx> {
|
fn const_u128<'ctx>(env: &Env<'_, 'ctx, '_>, value: u128) -> IntValue<'ctx> {
|
||||||
// truncate the lower 64 bits
|
// truncate the lower 64 bits
|
||||||
let value = value as u128;
|
let value = value;
|
||||||
let a = value as u64;
|
let a = value as u64;
|
||||||
|
|
||||||
// get the upper 64 bits
|
// get the upper 64 bits
|
||||||
|
@ -3352,8 +3349,8 @@ fn const_u128<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>, value: u128) -> IntValu
|
||||||
.const_int_arbitrary_precision(&[a, b])
|
.const_int_arbitrary_precision(&[a, b])
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_switch_ir<'a, 'ctx, 'env>(
|
fn build_switch_ir<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
func_spec_solutions: &FuncSpecSolutions,
|
func_spec_solutions: &FuncSpecSolutions,
|
||||||
|
@ -3488,7 +3485,7 @@ fn build_switch_ir<'a, 'ctx, 'env>(
|
||||||
let int_val = if condition_int_type == context.i128_type() {
|
let int_val = if condition_int_type == context.i128_type() {
|
||||||
const_i128(env, *int as i128)
|
const_i128(env, *int as i128)
|
||||||
} else {
|
} else {
|
||||||
condition_int_type.const_int(*int as u64, false)
|
condition_int_type.const_int(*int, false)
|
||||||
};
|
};
|
||||||
|
|
||||||
let block = context.append_basic_block(parent, format!("branch{}", int).as_str());
|
let block = context.append_basic_block(parent, format!("branch{}", int).as_str());
|
||||||
|
@ -3557,8 +3554,8 @@ fn build_switch_ir<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new stack allocation instruction in the entry block of the function.
|
/// Creates a new stack allocation instruction in the entry block of the function.
|
||||||
pub fn create_entry_block_alloca<'a, 'ctx>(
|
pub fn create_entry_block_alloca<'ctx>(
|
||||||
env: &Env<'a, 'ctx, '_>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
parent: FunctionValue<'_>,
|
parent: FunctionValue<'_>,
|
||||||
basic_type: BasicTypeEnum<'ctx>,
|
basic_type: BasicTypeEnum<'ctx>,
|
||||||
name: &str,
|
name: &str,
|
||||||
|
@ -3574,8 +3571,8 @@ pub fn create_entry_block_alloca<'a, 'ctx>(
|
||||||
builder.build_alloca(basic_type, name)
|
builder.build_alloca(basic_type, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expose_function_to_host<'a, 'ctx, 'env>(
|
fn expose_function_to_host<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
|
@ -3607,8 +3604,8 @@ fn expose_function_to_host<'a, 'ctx, 'env>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expose_function_to_host_help_c_abi_generic<'a, 'ctx, 'env>(
|
fn expose_function_to_host_help_c_abi_generic<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
arguments: &[InLayout<'a>],
|
arguments: &[InLayout<'a>],
|
||||||
|
@ -3753,8 +3750,8 @@ fn expose_function_to_host_help_c_abi_generic<'a, 'ctx, 'env>(
|
||||||
c_function
|
c_function
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expose_function_to_host_help_c_abi_gen_test<'a, 'ctx, 'env>(
|
fn expose_function_to_host_help_c_abi_gen_test<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
ident_string: &str,
|
ident_string: &str,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
|
@ -3915,8 +3912,8 @@ fn expose_function_to_host_help_c_abi_gen_test<'a, 'ctx, 'env>(
|
||||||
c_function
|
c_function
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expose_function_to_host_help_c_abi_v2<'a, 'ctx, 'env>(
|
fn expose_function_to_host_help_c_abi_v2<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
arguments: &[InLayout<'a>],
|
arguments: &[InLayout<'a>],
|
||||||
|
@ -4151,8 +4148,8 @@ fn expose_function_to_host_help_c_abi_v2<'a, 'ctx, 'env>(
|
||||||
c_function
|
c_function
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expose_function_to_host_help_c_abi<'a, 'ctx, 'env>(
|
fn expose_function_to_host_help_c_abi<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
ident_string: &str,
|
ident_string: &str,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
|
@ -4237,7 +4234,7 @@ fn expose_function_to_host_help_c_abi<'a, 'ctx, 'env>(
|
||||||
c_function
|
c_function
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_sjlj_buffer<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> PointerValue<'ctx> {
|
pub fn get_sjlj_buffer<'ctx>(env: &Env<'_, 'ctx, '_>) -> PointerValue<'ctx> {
|
||||||
// The size of jump_buf is target-dependent.
|
// The size of jump_buf is target-dependent.
|
||||||
// - AArch64 needs 3 machine-sized words
|
// - AArch64 needs 3 machine-sized words
|
||||||
// - LLVM says the following about the SJLJ intrinsic:
|
// - LLVM says the following about the SJLJ intrinsic:
|
||||||
|
@ -4269,7 +4266,7 @@ pub fn get_sjlj_buffer<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> PointerValu
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_setjmp_call<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> BasicValueEnum<'ctx> {
|
pub fn build_setjmp_call<'ctx>(env: &Env<'_, 'ctx, '_>) -> BasicValueEnum<'ctx> {
|
||||||
let jmp_buf = get_sjlj_buffer(env);
|
let jmp_buf = get_sjlj_buffer(env);
|
||||||
if cfg!(target_arch = "aarch64") {
|
if cfg!(target_arch = "aarch64") {
|
||||||
// Due to https://github.com/roc-lang/roc/issues/2965, we use a setjmp we linked in from Zig
|
// Due to https://github.com/roc-lang/roc/issues/2965, we use a setjmp we linked in from Zig
|
||||||
|
@ -4336,7 +4333,7 @@ pub fn build_setjmp_call<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> BasicValu
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Pointer to RocStr which is the panic message.
|
/// Pointer to RocStr which is the panic message.
|
||||||
pub fn get_panic_msg_ptr<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> PointerValue<'ctx> {
|
pub fn get_panic_msg_ptr<'ctx>(env: &Env<'_, 'ctx, '_>) -> PointerValue<'ctx> {
|
||||||
let str_typ = zig_str_type(env);
|
let str_typ = zig_str_type(env);
|
||||||
|
|
||||||
let global_name = "roc_panic_msg_str";
|
let global_name = "roc_panic_msg_str";
|
||||||
|
@ -4351,7 +4348,7 @@ pub fn get_panic_msg_ptr<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> PointerVa
|
||||||
|
|
||||||
/// Pointer to the panic tag.
|
/// Pointer to the panic tag.
|
||||||
/// Only non-zero values must be written into here.
|
/// Only non-zero values must be written into here.
|
||||||
pub fn get_panic_tag_ptr<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> PointerValue<'ctx> {
|
pub fn get_panic_tag_ptr<'ctx>(env: &Env<'_, 'ctx, '_>) -> PointerValue<'ctx> {
|
||||||
let i64_typ = env.context.i64_type();
|
let i64_typ = env.context.i64_type();
|
||||||
|
|
||||||
let global_name = "roc_panic_msg_tag";
|
let global_name = "roc_panic_msg_tag";
|
||||||
|
@ -4364,8 +4361,8 @@ pub fn get_panic_tag_ptr<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> PointerVa
|
||||||
global.as_pointer_value()
|
global.as_pointer_value()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_jump_and_catch_long_jump<'a, 'ctx, 'env>(
|
fn set_jump_and_catch_long_jump<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
|
@ -4446,8 +4443,8 @@ fn set_jump_and_catch_long_jump<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_exception_catcher<'a, 'ctx, 'env>(
|
fn make_exception_catcher<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
return_layout: InLayout<'a>,
|
return_layout: InLayout<'a>,
|
||||||
|
@ -4477,8 +4474,8 @@ fn roc_call_result_layout<'a>(
|
||||||
Layout::struct_no_name_order(arena.alloc(elements))
|
Layout::struct_no_name_order(arena.alloc(elements))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn roc_call_result_type<'a, 'ctx, 'env>(
|
fn roc_call_result_type<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
return_type: BasicTypeEnum<'ctx>,
|
return_type: BasicTypeEnum<'ctx>,
|
||||||
) -> StructType<'ctx> {
|
) -> StructType<'ctx> {
|
||||||
env.context.struct_type(
|
env.context.struct_type(
|
||||||
|
@ -4491,8 +4488,8 @@ fn roc_call_result_type<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_good_roc_result<'a, 'ctx, 'env>(
|
fn make_good_roc_result<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
return_layout: InLayout<'a>,
|
return_layout: InLayout<'a>,
|
||||||
return_value: BasicValueEnum<'ctx>,
|
return_value: BasicValueEnum<'ctx>,
|
||||||
|
@ -4530,8 +4527,8 @@ fn make_good_roc_result<'a, 'ctx, 'env>(
|
||||||
v3.into_struct_value().into()
|
v3.into_struct_value().into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_exception_catching_wrapper<'a, 'ctx, 'env>(
|
fn make_exception_catching_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
return_layout: InLayout<'a>,
|
return_layout: InLayout<'a>,
|
||||||
|
@ -4607,8 +4604,8 @@ fn make_exception_catching_wrapper<'a, 'ctx, 'env>(
|
||||||
wrapper_function
|
wrapper_function
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_proc_headers<'a, 'r, 'ctx, 'env>(
|
pub fn build_proc_headers<'a, 'r, 'ctx>(
|
||||||
env: &'r Env<'a, 'ctx, 'env>,
|
env: &'r Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &'r mut STLayoutInterner<'a>,
|
layout_interner: &'r mut STLayoutInterner<'a>,
|
||||||
mod_solutions: &'a ModSolutions,
|
mod_solutions: &'a ModSolutions,
|
||||||
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
||||||
|
@ -4655,8 +4652,8 @@ pub fn build_proc_headers<'a, 'r, 'ctx, 'env>(
|
||||||
headers
|
headers
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_procedures<'a, 'ctx, 'env>(
|
pub fn build_procedures<'a>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, '_, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
opt_level: OptLevel,
|
opt_level: OptLevel,
|
||||||
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
||||||
|
@ -4711,8 +4708,8 @@ pub fn build_procedures<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_wasm_test_wrapper<'a, 'ctx, 'env>(
|
pub fn build_wasm_test_wrapper<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
opt_level: OptLevel,
|
opt_level: OptLevel,
|
||||||
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
||||||
|
@ -4736,8 +4733,8 @@ pub fn build_wasm_test_wrapper<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_procedures_return_main<'a, 'ctx, 'env>(
|
pub fn build_procedures_return_main<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
opt_level: OptLevel,
|
opt_level: OptLevel,
|
||||||
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
||||||
|
@ -4761,8 +4758,8 @@ pub fn build_procedures_return_main<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_procedures_expose_expects<'a, 'ctx, 'env>(
|
pub fn build_procedures_expose_expects<'a>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, '_, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
opt_level: OptLevel,
|
opt_level: OptLevel,
|
||||||
expects: &'a [Symbol],
|
expects: &'a [Symbol],
|
||||||
|
@ -4832,8 +4829,8 @@ pub fn build_procedures_expose_expects<'a, 'ctx, 'env>(
|
||||||
expect_names
|
expect_names
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_procedures_help<'a, 'ctx, 'env>(
|
fn build_procedures_help<'a>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, '_, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
opt_level: OptLevel,
|
opt_level: OptLevel,
|
||||||
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
|
||||||
|
@ -4957,8 +4954,8 @@ fn func_spec_name<'a>(
|
||||||
buf
|
buf
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_proc_header<'a, 'ctx, 'env>(
|
fn build_proc_header<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
func_spec: FuncSpec,
|
func_spec: FuncSpec,
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
|
@ -5024,8 +5021,8 @@ fn build_proc_header<'a, 'ctx, 'env>(
|
||||||
fn_val
|
fn_val
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expose_alias_to_host<'a, 'ctx, 'env>(
|
fn expose_alias_to_host<'a>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, '_, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
mod_solutions: &'a ModSolutions,
|
mod_solutions: &'a ModSolutions,
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
|
@ -5105,8 +5102,8 @@ fn expose_alias_to_host<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_closure_caller<'a, 'ctx, 'env>(
|
fn build_closure_caller<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
def_name: &str,
|
def_name: &str,
|
||||||
evaluator: FunctionValue<'ctx>,
|
evaluator: FunctionValue<'ctx>,
|
||||||
|
@ -5236,8 +5233,8 @@ fn build_closure_caller<'a, 'ctx, 'env>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_host_exposed_alias_size<'a, 'r, 'ctx, 'env>(
|
fn build_host_exposed_alias_size<'a, 'r>(
|
||||||
env: &'r Env<'a, 'ctx, 'env>,
|
env: &'r Env<'a, '_, '_>,
|
||||||
layout_interner: &'r mut STLayoutInterner<'a>,
|
layout_interner: &'r mut STLayoutInterner<'a>,
|
||||||
def_name: &str,
|
def_name: &str,
|
||||||
alias_symbol: Symbol,
|
alias_symbol: Symbol,
|
||||||
|
@ -5252,8 +5249,8 @@ fn build_host_exposed_alias_size<'a, 'r, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_host_exposed_alias_size_help<'a, 'ctx, 'env>(
|
fn build_host_exposed_alias_size_help<'a, 'ctx>(
|
||||||
env: &'a Env<'a, 'ctx, 'env>,
|
env: &'a Env<'a, 'ctx, '_>,
|
||||||
def_name: &str,
|
def_name: &str,
|
||||||
_alias_symbol: Symbol,
|
_alias_symbol: Symbol,
|
||||||
opt_label: Option<&str>,
|
opt_label: Option<&str>,
|
||||||
|
@ -5286,8 +5283,8 @@ fn build_host_exposed_alias_size_help<'a, 'ctx, 'env>(
|
||||||
builder.build_return(Some(&size));
|
builder.build_return(Some(&size));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_proc<'a, 'ctx, 'env>(
|
fn build_proc<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
mod_solutions: &'a ModSolutions,
|
mod_solutions: &'a ModSolutions,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
|
@ -5371,8 +5368,8 @@ pub fn verify_fn(fn_val: FunctionValue<'_>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn function_value_by_func_spec<'a, 'ctx, 'env>(
|
pub(crate) fn function_value_by_func_spec<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
func_spec: FuncSpec,
|
func_spec: FuncSpec,
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
arguments: &[InLayout<'a>],
|
arguments: &[InLayout<'a>],
|
||||||
|
@ -5385,8 +5382,8 @@ pub(crate) fn function_value_by_func_spec<'a, 'ctx, 'env>(
|
||||||
function_value_by_name_help(env, arguments, niche, result, symbol, fn_name)
|
function_value_by_name_help(env, arguments, niche, result, symbol, fn_name)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn function_value_by_name_help<'a, 'ctx, 'env>(
|
fn function_value_by_name_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
arguments: &[InLayout<'a>],
|
arguments: &[InLayout<'a>],
|
||||||
_niche: Niche<'a>,
|
_niche: Niche<'a>,
|
||||||
result: InLayout<'a>,
|
result: InLayout<'a>,
|
||||||
|
@ -5425,8 +5422,8 @@ fn function_value_by_name_help<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn roc_call_with_args<'a, 'ctx, 'env>(
|
fn roc_call_with_args<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
argument_layouts: &[InLayout<'a>],
|
argument_layouts: &[InLayout<'a>],
|
||||||
result_layout: InLayout<'a>,
|
result_layout: InLayout<'a>,
|
||||||
|
@ -5446,8 +5443,8 @@ fn roc_call_with_args<'a, 'ctx, 'env>(
|
||||||
call_roc_function(env, layout_interner, fn_val, result_layout, arguments)
|
call_roc_function(env, layout_interner, fn_val, result_layout, arguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn call_roc_function<'a, 'ctx, 'env>(
|
pub fn call_roc_function<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
roc_function: FunctionValue<'ctx>,
|
roc_function: FunctionValue<'ctx>,
|
||||||
result_layout: InLayout<'a>,
|
result_layout: InLayout<'a>,
|
||||||
|
@ -5561,8 +5558,8 @@ pub struct RocFunctionCall<'ctx> {
|
||||||
pub data_is_owned: IntValue<'ctx>,
|
pub data_is_owned: IntValue<'ctx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn roc_function_call<'a, 'ctx, 'env>(
|
pub(crate) fn roc_function_call<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
transform: FunctionValue<'ctx>,
|
transform: FunctionValue<'ctx>,
|
||||||
|
@ -5616,8 +5613,8 @@ pub(crate) fn roc_function_call<'a, 'ctx, 'env>(
|
||||||
///
|
///
|
||||||
/// As an example, structs that fit inside an integer type should
|
/// As an example, structs that fit inside an integer type should
|
||||||
/// (this does not currently happen here) be coerced to that integer type.
|
/// (this does not currently happen here) be coerced to that integer type.
|
||||||
fn to_cc_type<'a, 'ctx, 'env>(
|
fn to_cc_type<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
) -> BasicTypeEnum<'ctx> {
|
) -> BasicTypeEnum<'ctx> {
|
||||||
|
@ -5630,8 +5627,8 @@ fn to_cc_type<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn to_cc_type_builtin<'a, 'ctx, 'env>(
|
fn to_cc_type_builtin<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
builtin: &Builtin<'a>,
|
builtin: &Builtin<'a>,
|
||||||
) -> BasicTypeEnum<'ctx> {
|
) -> BasicTypeEnum<'ctx> {
|
||||||
match builtin {
|
match builtin {
|
||||||
|
@ -5691,8 +5688,8 @@ impl RocReturn {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn from_layout<'a, 'ctx, 'env>(
|
pub(crate) fn from_layout<'a>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, '_, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
@ -5832,8 +5829,8 @@ impl<'ctx> FunctionSpec<'ctx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// According to the C ABI, how should we return a value with the given layout?
|
/// According to the C ABI, how should we return a value with the given layout?
|
||||||
pub fn to_cc_return<'a, 'ctx, 'env>(
|
pub fn to_cc_return<'a>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, '_, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
) -> CCReturn {
|
) -> CCReturn {
|
||||||
|
@ -5855,16 +5852,16 @@ pub fn to_cc_return<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn function_arguments<'a, 'ctx, 'env>(
|
fn function_arguments<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
arguments: &[BasicTypeEnum<'ctx>],
|
arguments: &[BasicTypeEnum<'ctx>],
|
||||||
) -> Vec<'a, BasicMetadataTypeEnum<'ctx>> {
|
) -> Vec<'a, BasicMetadataTypeEnum<'ctx>> {
|
||||||
let it = arguments.iter().map(|x| (*x).into());
|
let it = arguments.iter().map(|x| (*x).into());
|
||||||
Vec::from_iter_in(it, env.arena)
|
Vec::from_iter_in(it, env.arena)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_foreign_symbol<'a, 'ctx, 'env>(
|
fn build_foreign_symbol<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
scope: &mut Scope<'a, 'ctx>,
|
scope: &mut Scope<'a, 'ctx>,
|
||||||
foreign: &roc_module::ident::ForeignSymbol,
|
foreign: &roc_module::ident::ForeignSymbol,
|
||||||
|
@ -6038,8 +6035,8 @@ fn build_foreign_symbol<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn define_global_str_literal_ptr<'a, 'ctx, 'env>(
|
fn define_global_str_literal_ptr<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
message: &str,
|
message: &str,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
let global = define_global_str_literal(env, message);
|
let global = define_global_str_literal(env, message);
|
||||||
|
@ -6065,8 +6062,8 @@ fn define_global_str_literal_ptr<'a, 'ctx, 'env>(
|
||||||
ptr
|
ptr
|
||||||
}
|
}
|
||||||
|
|
||||||
fn define_global_str_literal<'a, 'ctx, 'env>(
|
fn define_global_str_literal<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
message: &str,
|
message: &str,
|
||||||
) -> inkwell::values::GlobalValue<'ctx> {
|
) -> inkwell::values::GlobalValue<'ctx> {
|
||||||
let module = env.module;
|
let module = env.module;
|
||||||
|
@ -6119,8 +6116,8 @@ fn define_global_str_literal<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn throw_internal_exception<'a, 'ctx, 'env>(
|
pub(crate) fn throw_internal_exception<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
message: &str,
|
message: &str,
|
||||||
) {
|
) {
|
||||||
|
@ -6133,8 +6130,8 @@ pub(crate) fn throw_internal_exception<'a, 'ctx, 'env>(
|
||||||
builder.build_unreachable();
|
builder.build_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn throw_exception<'a, 'ctx, 'env>(
|
pub(crate) fn throw_exception<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
scope: &mut Scope<'a, 'ctx>,
|
scope: &mut Scope<'a, 'ctx>,
|
||||||
message: &Symbol,
|
message: &Symbol,
|
||||||
tag: CrashTag,
|
tag: CrashTag,
|
||||||
|
@ -6146,8 +6143,8 @@ pub(crate) fn throw_exception<'a, 'ctx, 'env>(
|
||||||
env.builder.build_unreachable();
|
env.builder.build_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_foreign_symbol<'a, 'ctx, 'env>(
|
fn get_foreign_symbol<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
foreign_symbol: roc_module::ident::ForeignSymbol,
|
foreign_symbol: roc_module::ident::ForeignSymbol,
|
||||||
function_spec: FunctionSpec<'ctx>,
|
function_spec: FunctionSpec<'ctx>,
|
||||||
) -> FunctionValue<'ctx> {
|
) -> FunctionValue<'ctx> {
|
||||||
|
|
|
@ -20,8 +20,8 @@ use super::build::{
|
||||||
};
|
};
|
||||||
use super::convert::zig_list_type;
|
use super::convert::zig_list_type;
|
||||||
|
|
||||||
fn call_list_bitcode_fn_1<'a, 'ctx, 'env>(
|
fn call_list_bitcode_fn_1<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
list: StructValue<'ctx>,
|
list: StructValue<'ctx>,
|
||||||
other_arguments: &[BasicValueEnum<'ctx>],
|
other_arguments: &[BasicValueEnum<'ctx>],
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
|
@ -29,8 +29,8 @@ fn call_list_bitcode_fn_1<'a, 'ctx, 'env>(
|
||||||
call_list_bitcode_fn(env, &[list], other_arguments, BitcodeReturns::List, fn_name)
|
call_list_bitcode_fn(env, &[list], other_arguments, BitcodeReturns::List, fn_name)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn list_symbol_to_c_abi<'a, 'ctx, 'env>(
|
pub(crate) fn list_symbol_to_c_abi<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
scope: &Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
symbol: Symbol,
|
symbol: Symbol,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
|
@ -49,8 +49,8 @@ pub(crate) fn list_symbol_to_c_abi<'a, 'ctx, 'env>(
|
||||||
list_alloca
|
list_alloca
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn pass_update_mode<'a, 'ctx, 'env>(
|
pub(crate) fn pass_update_mode<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
update_mode: UpdateMode,
|
update_mode: UpdateMode,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
match update_mode {
|
match update_mode {
|
||||||
|
@ -59,8 +59,8 @@ pub(crate) fn pass_update_mode<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pass_element_as_opaque<'a, 'ctx, 'env>(
|
fn pass_element_as_opaque<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
element: BasicValueEnum<'ctx>,
|
element: BasicValueEnum<'ctx>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
|
@ -80,8 +80,8 @@ fn pass_element_as_opaque<'a, 'ctx, 'env>(
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn layout_width<'a, 'ctx, 'env>(
|
pub(crate) fn layout_width<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -90,8 +90,8 @@ pub(crate) fn layout_width<'a, 'ctx, 'env>(
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn pass_as_opaque<'a, 'ctx, 'env>(
|
pub(crate) fn pass_as_opaque<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
env.builder
|
env.builder
|
||||||
|
@ -103,8 +103,8 @@ pub(crate) fn pass_as_opaque<'a, 'ctx, 'env>(
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn list_with_capacity<'a, 'ctx, 'env>(
|
pub(crate) fn list_with_capacity<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
capacity: IntValue<'ctx>,
|
capacity: IntValue<'ctx>,
|
||||||
element_layout: InLayout<'a>,
|
element_layout: InLayout<'a>,
|
||||||
|
@ -122,8 +122,8 @@ pub(crate) fn list_with_capacity<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn list_get_unsafe<'a, 'ctx, 'env>(
|
pub(crate) fn list_get_unsafe<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
element_layout: InLayout<'a>,
|
element_layout: InLayout<'a>,
|
||||||
|
@ -162,8 +162,8 @@ pub(crate) fn list_get_unsafe<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.reserve : List elem, Nat -> List elem
|
/// List.reserve : List elem, Nat -> List elem
|
||||||
pub(crate) fn list_reserve<'a, 'ctx, 'env>(
|
pub(crate) fn list_reserve<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
list: BasicValueEnum<'ctx>,
|
list: BasicValueEnum<'ctx>,
|
||||||
spare: BasicValueEnum<'ctx>,
|
spare: BasicValueEnum<'ctx>,
|
||||||
|
@ -184,8 +184,8 @@ pub(crate) fn list_reserve<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.releaseExcessCapacity : List elem -> List elem
|
/// List.releaseExcessCapacity : List elem -> List elem
|
||||||
pub(crate) fn list_release_excess_capacity<'a, 'ctx, 'env>(
|
pub(crate) fn list_release_excess_capacity<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
list: BasicValueEnum<'ctx>,
|
list: BasicValueEnum<'ctx>,
|
||||||
element_layout: InLayout<'a>,
|
element_layout: InLayout<'a>,
|
||||||
|
@ -204,8 +204,8 @@ pub(crate) fn list_release_excess_capacity<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.appendUnsafe : List elem, elem -> List elem
|
/// List.appendUnsafe : List elem, elem -> List elem
|
||||||
pub(crate) fn list_append_unsafe<'a, 'ctx, 'env>(
|
pub(crate) fn list_append_unsafe<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
original_wrapper: StructValue<'ctx>,
|
original_wrapper: StructValue<'ctx>,
|
||||||
element: BasicValueEnum<'ctx>,
|
element: BasicValueEnum<'ctx>,
|
||||||
|
@ -223,8 +223,8 @@ pub(crate) fn list_append_unsafe<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.prepend : List elem, elem -> List elem
|
/// List.prepend : List elem, elem -> List elem
|
||||||
pub(crate) fn list_prepend<'a, 'ctx, 'env>(
|
pub(crate) fn list_prepend<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
original_wrapper: StructValue<'ctx>,
|
original_wrapper: StructValue<'ctx>,
|
||||||
element: BasicValueEnum<'ctx>,
|
element: BasicValueEnum<'ctx>,
|
||||||
|
@ -243,8 +243,8 @@ pub(crate) fn list_prepend<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.swap : List elem, Nat, Nat -> List elem
|
/// List.swap : List elem, Nat, Nat -> List elem
|
||||||
pub(crate) fn list_swap<'a, 'ctx, 'env>(
|
pub(crate) fn list_swap<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
original_wrapper: StructValue<'ctx>,
|
original_wrapper: StructValue<'ctx>,
|
||||||
index_1: IntValue<'ctx>,
|
index_1: IntValue<'ctx>,
|
||||||
|
@ -267,8 +267,8 @@ pub(crate) fn list_swap<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.sublist : List elem, { start : Nat, len : Nat } -> List elem
|
/// List.sublist : List elem, { start : Nat, len : Nat } -> List elem
|
||||||
pub(crate) fn list_sublist<'a, 'ctx, 'env>(
|
pub(crate) fn list_sublist<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
original_wrapper: StructValue<'ctx>,
|
original_wrapper: StructValue<'ctx>,
|
||||||
|
@ -292,8 +292,8 @@ pub(crate) fn list_sublist<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.dropAt : List elem, Nat -> List elem
|
/// List.dropAt : List elem, Nat -> List elem
|
||||||
pub(crate) fn list_drop_at<'a, 'ctx, 'env>(
|
pub(crate) fn list_drop_at<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
original_wrapper: StructValue<'ctx>,
|
original_wrapper: StructValue<'ctx>,
|
||||||
|
@ -315,8 +315,8 @@ pub(crate) fn list_drop_at<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.replace_unsafe : List elem, Nat, elem -> { list: List elem, value: elem }
|
/// List.replace_unsafe : List elem, Nat, elem -> { list: List elem, value: elem }
|
||||||
pub(crate) fn list_replace_unsafe<'a, 'ctx, 'env>(
|
pub(crate) fn list_replace_unsafe<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
_layout_ids: &mut LayoutIds<'a>,
|
_layout_ids: &mut LayoutIds<'a>,
|
||||||
list: BasicValueEnum<'ctx>,
|
list: BasicValueEnum<'ctx>,
|
||||||
|
@ -429,8 +429,8 @@ pub(crate) fn list_capacity_or_ref_ptr<'ctx>(
|
||||||
|
|
||||||
// Gets a pointer to just after the refcount for a list or seamless slice.
|
// Gets a pointer to just after the refcount for a list or seamless slice.
|
||||||
// The value is just after the refcount so that normal lists and seamless slices can share code paths easily.
|
// The value is just after the refcount so that normal lists and seamless slices can share code paths easily.
|
||||||
pub(crate) fn list_refcount_ptr<'a, 'ctx, 'env>(
|
pub(crate) fn list_refcount_ptr<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
wrapper_struct: StructValue<'ctx>,
|
wrapper_struct: StructValue<'ctx>,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
call_list_bitcode_fn(
|
call_list_bitcode_fn(
|
||||||
|
@ -467,8 +467,8 @@ pub(crate) fn destructure<'ctx>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.sortWith : List a, (a, a -> Ordering) -> List a
|
/// List.sortWith : List a, (a, a -> Ordering) -> List a
|
||||||
pub(crate) fn list_sort_with<'a, 'ctx, 'env>(
|
pub(crate) fn list_sort_with<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
roc_function_call: RocFunctionCall<'ctx>,
|
roc_function_call: RocFunctionCall<'ctx>,
|
||||||
compare_wrapper: PointerValue<'ctx>,
|
compare_wrapper: PointerValue<'ctx>,
|
||||||
|
@ -491,8 +491,8 @@ pub(crate) fn list_sort_with<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.map : List before, (before -> after) -> List after
|
/// List.map : List before, (before -> after) -> List after
|
||||||
pub(crate) fn list_map<'a, 'ctx, 'env>(
|
pub(crate) fn list_map<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
roc_function_call: RocFunctionCall<'ctx>,
|
roc_function_call: RocFunctionCall<'ctx>,
|
||||||
list: BasicValueEnum<'ctx>,
|
list: BasicValueEnum<'ctx>,
|
||||||
|
@ -515,8 +515,8 @@ pub(crate) fn list_map<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn list_map2<'a, 'ctx, 'env>(
|
pub(crate) fn list_map2<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
roc_function_call: RocFunctionCall<'ctx>,
|
roc_function_call: RocFunctionCall<'ctx>,
|
||||||
|
@ -549,8 +549,8 @@ pub(crate) fn list_map2<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn list_map3<'a, 'ctx, 'env>(
|
pub(crate) fn list_map3<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
roc_function_call: RocFunctionCall<'ctx>,
|
roc_function_call: RocFunctionCall<'ctx>,
|
||||||
|
@ -592,8 +592,8 @@ pub(crate) fn list_map3<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn list_map4<'a, 'ctx, 'env>(
|
pub(crate) fn list_map4<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
roc_function_call: RocFunctionCall<'ctx>,
|
roc_function_call: RocFunctionCall<'ctx>,
|
||||||
|
@ -642,8 +642,8 @@ pub(crate) fn list_map4<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.concat : List elem, List elem -> List elem
|
/// List.concat : List elem, List elem -> List elem
|
||||||
pub(crate) fn list_concat<'a, 'ctx, 'env>(
|
pub(crate) fn list_concat<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
list1: BasicValueEnum<'ctx>,
|
list1: BasicValueEnum<'ctx>,
|
||||||
list2: BasicValueEnum<'ctx>,
|
list2: BasicValueEnum<'ctx>,
|
||||||
|
@ -756,9 +756,7 @@ where
|
||||||
index_alloca
|
index_alloca
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn empty_polymorphic_list<'a, 'ctx, 'env>(
|
pub(crate) fn empty_polymorphic_list<'ctx>(env: &Env<'_, 'ctx, '_>) -> BasicValueEnum<'ctx> {
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
|
||||||
) -> BasicValueEnum<'ctx> {
|
|
||||||
let struct_type = zig_list_type(env);
|
let struct_type = zig_list_type(env);
|
||||||
|
|
||||||
// The pointer should be null (aka zero) and the length should be zero,
|
// The pointer should be null (aka zero) and the length should be zero,
|
||||||
|
@ -796,8 +794,8 @@ pub(crate) fn load_list_ptr<'ctx>(
|
||||||
cast_basic_basic(builder, generic_ptr.into(), ptr_type.into()).into_pointer_value()
|
cast_basic_basic(builder, generic_ptr.into(), ptr_type.into()).into_pointer_value()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn allocate_list<'a, 'ctx, 'env>(
|
pub(crate) fn allocate_list<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
elem_layout: InLayout<'a>,
|
elem_layout: InLayout<'a>,
|
||||||
number_of_elements: IntValue<'ctx>,
|
number_of_elements: IntValue<'ctx>,
|
||||||
|
@ -815,8 +813,8 @@ pub(crate) fn allocate_list<'a, 'ctx, 'env>(
|
||||||
allocate_with_refcount_help(env, basic_type, alignment_bytes, number_of_data_bytes)
|
allocate_with_refcount_help(env, basic_type, alignment_bytes, number_of_data_bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn store_list<'a, 'ctx, 'env>(
|
pub(crate) fn store_list<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
pointer_to_first_element: PointerValue<'ctx>,
|
pointer_to_first_element: PointerValue<'ctx>,
|
||||||
len: IntValue<'ctx>,
|
len: IntValue<'ctx>,
|
||||||
) -> StructValue<'ctx> {
|
) -> StructValue<'ctx> {
|
||||||
|
@ -835,8 +833,8 @@ pub(crate) fn store_list<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn decref<'a, 'ctx, 'env>(
|
pub(crate) fn decref<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
wrapper_struct: StructValue<'ctx>,
|
wrapper_struct: StructValue<'ctx>,
|
||||||
alignment: u32,
|
alignment: u32,
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -10,8 +10,8 @@ use super::build::BuilderExt;
|
||||||
|
|
||||||
pub static CHAR_LAYOUT: InLayout = Layout::U8;
|
pub static CHAR_LAYOUT: InLayout = Layout::U8;
|
||||||
|
|
||||||
pub(crate) fn decode_from_utf8_result<'a, 'ctx, 'env>(
|
pub(crate) fn decode_from_utf8_result<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
pointer: PointerValue<'ctx>,
|
pointer: PointerValue<'ctx>,
|
||||||
) -> StructValue<'ctx> {
|
) -> StructValue<'ctx> {
|
||||||
let builder = env.builder;
|
let builder = env.builder;
|
||||||
|
@ -50,8 +50,8 @@ pub(crate) fn decode_from_utf8_result<'a, 'ctx, 'env>(
|
||||||
/// Dec.toStr : Dec -> Str
|
/// Dec.toStr : Dec -> Str
|
||||||
|
|
||||||
/// Str.equal : Str, Str -> Bool
|
/// Str.equal : Str, Str -> Bool
|
||||||
pub(crate) fn str_equal<'a, 'ctx, 'env>(
|
pub(crate) fn str_equal<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
value1: BasicValueEnum<'ctx>,
|
value1: BasicValueEnum<'ctx>,
|
||||||
value2: BasicValueEnum<'ctx>,
|
value2: BasicValueEnum<'ctx>,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -66,8 +66,8 @@ pub(crate) fn str_equal<'a, 'ctx, 'env>(
|
||||||
|
|
||||||
// Gets a pointer to just after the refcount for a list or seamless slice.
|
// Gets a pointer to just after the refcount for a list or seamless slice.
|
||||||
// The value is just after the refcount so that normal lists and seamless slices can share code paths easily.
|
// The value is just after the refcount so that normal lists and seamless slices can share code paths easily.
|
||||||
pub(crate) fn str_refcount_ptr<'a, 'ctx, 'env>(
|
pub(crate) fn str_refcount_ptr<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
value: BasicValueEnum<'ctx>,
|
value: BasicValueEnum<'ctx>,
|
||||||
) -> PointerValue<'ctx> {
|
) -> PointerValue<'ctx> {
|
||||||
call_str_bitcode_fn(
|
call_str_bitcode_fn(
|
||||||
|
|
|
@ -18,8 +18,8 @@ use super::build::{load_roc_value, use_roc_value, BuilderExt};
|
||||||
use super::convert::argument_type_from_union_layout;
|
use super::convert::argument_type_from_union_layout;
|
||||||
use super::lowlevel::dec_binop_with_unchecked;
|
use super::lowlevel::dec_binop_with_unchecked;
|
||||||
|
|
||||||
pub fn generic_eq<'a, 'ctx, 'env>(
|
pub fn generic_eq<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
lhs_val: BasicValueEnum<'ctx>,
|
lhs_val: BasicValueEnum<'ctx>,
|
||||||
|
@ -38,8 +38,8 @@ pub fn generic_eq<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn generic_neq<'a, 'ctx, 'env>(
|
pub fn generic_neq<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
lhs_val: BasicValueEnum<'ctx>,
|
lhs_val: BasicValueEnum<'ctx>,
|
||||||
|
@ -58,8 +58,8 @@ pub fn generic_neq<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_eq_builtin<'a, 'ctx, 'env>(
|
fn build_eq_builtin<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
lhs_val: BasicValueEnum<'ctx>,
|
lhs_val: BasicValueEnum<'ctx>,
|
||||||
|
@ -136,8 +136,8 @@ fn build_eq_builtin<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_eq<'a, 'ctx, 'env>(
|
fn build_eq<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
lhs_val: BasicValueEnum<'ctx>,
|
lhs_val: BasicValueEnum<'ctx>,
|
||||||
|
@ -236,8 +236,8 @@ fn build_eq<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_neq_builtin<'a, 'ctx, 'env>(
|
fn build_neq_builtin<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
lhs_val: BasicValueEnum<'ctx>,
|
lhs_val: BasicValueEnum<'ctx>,
|
||||||
|
@ -326,8 +326,8 @@ fn build_neq_builtin<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_neq<'a, 'ctx, 'env>(
|
fn build_neq<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
lhs_val: BasicValueEnum<'ctx>,
|
lhs_val: BasicValueEnum<'ctx>,
|
||||||
|
@ -411,8 +411,8 @@ fn build_neq<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_list_eq<'a, 'ctx, 'env>(
|
fn build_list_eq<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
list_layout: InLayout<'a>,
|
list_layout: InLayout<'a>,
|
||||||
|
@ -469,8 +469,8 @@ fn build_list_eq<'a, 'ctx, 'env>(
|
||||||
call.try_as_basic_value().left().unwrap()
|
call.try_as_basic_value().left().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_list_eq_help<'a, 'ctx, 'env>(
|
fn build_list_eq_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
|
@ -627,8 +627,8 @@ fn build_list_eq_help<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_struct_eq<'a, 'ctx, 'env>(
|
fn build_struct_eq<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
struct_layout: InLayout<'a>,
|
struct_layout: InLayout<'a>,
|
||||||
|
@ -679,8 +679,8 @@ fn build_struct_eq<'a, 'ctx, 'env>(
|
||||||
call.try_as_basic_value().left().unwrap()
|
call.try_as_basic_value().left().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_struct_eq_help<'a, 'ctx, 'env>(
|
fn build_struct_eq_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
|
@ -812,8 +812,8 @@ fn build_struct_eq_help<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_tag_eq<'a, 'ctx, 'env>(
|
fn build_tag_eq<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
tag_layout: InLayout<'a>,
|
tag_layout: InLayout<'a>,
|
||||||
|
@ -864,8 +864,8 @@ fn build_tag_eq<'a, 'ctx, 'env>(
|
||||||
call.try_as_basic_value().left().unwrap()
|
call.try_as_basic_value().left().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_tag_eq_help<'a, 'ctx, 'env>(
|
fn build_tag_eq_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
|
@ -1265,8 +1265,8 @@ fn build_tag_eq_help<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn eq_ptr_to_struct<'a, 'ctx, 'env>(
|
fn eq_ptr_to_struct<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
struct_layout: InLayout<'a>,
|
struct_layout: InLayout<'a>,
|
||||||
|
@ -1314,8 +1314,8 @@ fn eq_ptr_to_struct<'a, 'ctx, 'env>(
|
||||||
|
|
||||||
/// ----
|
/// ----
|
||||||
|
|
||||||
fn build_box_eq<'a, 'ctx, 'env>(
|
fn build_box_eq<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
box_layout: InLayout<'a>,
|
box_layout: InLayout<'a>,
|
||||||
|
@ -1366,8 +1366,8 @@ fn build_box_eq<'a, 'ctx, 'env>(
|
||||||
call.try_as_basic_value().left().unwrap()
|
call.try_as_basic_value().left().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_box_eq_help<'a, 'ctx, 'env>(
|
fn build_box_eq_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
|
|
|
@ -10,8 +10,8 @@ use roc_mono::layout::{
|
||||||
};
|
};
|
||||||
use roc_target::TargetInfo;
|
use roc_target::TargetInfo;
|
||||||
|
|
||||||
fn basic_type_from_record<'a, 'ctx, 'env>(
|
fn basic_type_from_record<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
fields: &[InLayout<'_>],
|
fields: &[InLayout<'_>],
|
||||||
) -> BasicTypeEnum<'ctx> {
|
) -> BasicTypeEnum<'ctx> {
|
||||||
|
@ -59,8 +59,8 @@ pub fn basic_type_from_layout<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn struct_type_from_union_layout<'a, 'ctx, 'env>(
|
pub fn struct_type_from_union_layout<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
union_layout: &UnionLayout<'_>,
|
union_layout: &UnionLayout<'_>,
|
||||||
) -> StructType<'ctx> {
|
) -> StructType<'ctx> {
|
||||||
|
@ -98,8 +98,8 @@ pub fn struct_type_from_union_layout<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn basic_type_from_union_layout<'a, 'ctx, 'env>(
|
pub fn basic_type_from_union_layout<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
union_layout: &UnionLayout<'_>,
|
union_layout: &UnionLayout<'_>,
|
||||||
) -> BasicTypeEnum<'ctx> {
|
) -> BasicTypeEnum<'ctx> {
|
||||||
|
@ -116,8 +116,8 @@ pub fn basic_type_from_union_layout<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn basic_type_from_builtin<'a, 'ctx, 'env>(
|
pub fn basic_type_from_builtin<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
builtin: &Builtin<'_>,
|
builtin: &Builtin<'_>,
|
||||||
) -> BasicTypeEnum<'ctx> {
|
) -> BasicTypeEnum<'ctx> {
|
||||||
use Builtin::*;
|
use Builtin::*;
|
||||||
|
@ -145,8 +145,8 @@ pub fn basic_type_from_builtin<'a, 'ctx, 'env>(
|
||||||
///
|
///
|
||||||
/// Ideas exist to have (bigger than 2 register) records also be passed by-reference, but this
|
/// Ideas exist to have (bigger than 2 register) records also be passed by-reference, but this
|
||||||
/// is not currently implemented
|
/// is not currently implemented
|
||||||
pub fn argument_type_from_layout<'a, 'ctx, 'env>(
|
pub fn argument_type_from_layout<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
) -> BasicTypeEnum<'ctx> {
|
) -> BasicTypeEnum<'ctx> {
|
||||||
|
@ -171,8 +171,8 @@ pub fn argument_type_from_layout<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Non-recursive tag unions are stored on the stack, but passed by-reference
|
/// Non-recursive tag unions are stored on the stack, but passed by-reference
|
||||||
pub fn argument_type_from_union_layout<'a, 'ctx, 'env>(
|
pub fn argument_type_from_union_layout<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
union_layout: &UnionLayout<'_>,
|
union_layout: &UnionLayout<'_>,
|
||||||
) -> BasicTypeEnum<'ctx> {
|
) -> BasicTypeEnum<'ctx> {
|
||||||
|
@ -185,8 +185,8 @@ pub fn argument_type_from_union_layout<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn int_type_from_int_width<'a, 'ctx, 'env>(
|
pub fn int_type_from_int_width<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
int_width: IntWidth,
|
int_width: IntWidth,
|
||||||
) -> IntType<'ctx> {
|
) -> IntType<'ctx> {
|
||||||
use IntWidth::*;
|
use IntWidth::*;
|
||||||
|
@ -200,8 +200,8 @@ pub fn int_type_from_int_width<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn float_type_from_float_width<'a, 'ctx, 'env>(
|
pub fn float_type_from_float_width<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
float_width: FloatWidth,
|
float_width: FloatWidth,
|
||||||
) -> FloatType<'ctx> {
|
) -> FloatType<'ctx> {
|
||||||
use FloatWidth::*;
|
use FloatWidth::*;
|
||||||
|
@ -431,27 +431,27 @@ pub fn str_list_int(ctx: &Context, target_info: TargetInfo) -> IntType<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn zig_list_type<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> StructType<'ctx> {
|
pub fn zig_list_type<'ctx>(env: &Env<'_, 'ctx, '_>) -> StructType<'ctx> {
|
||||||
env.module.get_struct_type("list.RocList").unwrap()
|
env.module.get_struct_type("list.RocList").unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn zig_str_type<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> StructType<'ctx> {
|
pub fn zig_str_type<'ctx>(env: &Env<'_, 'ctx, '_>) -> StructType<'ctx> {
|
||||||
env.module.get_struct_type("str.RocStr").unwrap()
|
env.module.get_struct_type("str.RocStr").unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn zig_dec_type<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> StructType<'ctx> {
|
pub fn zig_dec_type<'ctx>(env: &Env<'_, 'ctx, '_>) -> StructType<'ctx> {
|
||||||
env.module.get_struct_type("dec.RocDec").unwrap()
|
env.module.get_struct_type("dec.RocDec").unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn zig_has_tag_id_type<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> StructType<'ctx> {
|
pub fn zig_has_tag_id_type<'ctx>(env: &Env<'_, 'ctx, '_>) -> StructType<'ctx> {
|
||||||
let u8_ptr_t = env.context.i8_type().ptr_type(AddressSpace::default());
|
let u8_ptr_t = env.context.i8_type().ptr_type(AddressSpace::default());
|
||||||
|
|
||||||
env.context
|
env.context
|
||||||
.struct_type(&[env.context.bool_type().into(), u8_ptr_t.into()], false)
|
.struct_type(&[env.context.bool_type().into(), u8_ptr_t.into()], false)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn zig_num_parse_result_type<'a, 'ctx, 'env>(
|
pub fn zig_num_parse_result_type<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
type_name: &str,
|
type_name: &str,
|
||||||
) -> StructType<'ctx> {
|
) -> StructType<'ctx> {
|
||||||
let name = format!("num.NumParseResult({type_name})");
|
let name = format!("num.NumParseResult({type_name})");
|
||||||
|
@ -462,8 +462,8 @@ pub fn zig_num_parse_result_type<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn zig_to_int_checked_result_type<'a, 'ctx, 'env>(
|
pub fn zig_to_int_checked_result_type<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
type_name: &str,
|
type_name: &str,
|
||||||
) -> StructType<'ctx> {
|
) -> StructType<'ctx> {
|
||||||
let name = format!("num.ToIntCheckedResult({type_name})");
|
let name = format!("num.ToIntCheckedResult({type_name})");
|
||||||
|
@ -474,7 +474,7 @@ pub fn zig_to_int_checked_result_type<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn zig_with_overflow_roc_dec<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> StructType<'ctx> {
|
pub fn zig_with_overflow_roc_dec<'ctx>(env: &Env<'_, 'ctx, '_>) -> StructType<'ctx> {
|
||||||
env.module
|
env.module
|
||||||
.get_struct_type("utils.WithOverflow(dec.RocDec)")
|
.get_struct_type("utils.WithOverflow(dec.RocDec)")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
|
@ -66,8 +66,8 @@ fn pointer_at_offset<'ctx>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Writes the module and region into the buffer
|
/// Writes the module and region into the buffer
|
||||||
fn write_header<'a, 'ctx, 'env>(
|
fn write_header<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
mut offset: IntValue<'ctx>,
|
mut offset: IntValue<'ctx>,
|
||||||
condition: Symbol,
|
condition: Symbol,
|
||||||
|
@ -95,8 +95,8 @@ fn write_header<'a, 'ctx, 'env>(
|
||||||
|
|
||||||
/// Read the first two 32-bit values from the shared memory,
|
/// Read the first two 32-bit values from the shared memory,
|
||||||
/// representing the total number of expect frames and the next free position
|
/// representing the total number of expect frames and the next free position
|
||||||
fn read_state<'a, 'ctx, 'env>(
|
fn read_state<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
) -> (IntValue<'ctx>, IntValue<'ctx>) {
|
) -> (IntValue<'ctx>, IntValue<'ctx>) {
|
||||||
let ptr_type = env.ptr_int().ptr_type(AddressSpace::default());
|
let ptr_type = env.ptr_int().ptr_type(AddressSpace::default());
|
||||||
|
@ -113,8 +113,8 @@ fn read_state<'a, 'ctx, 'env>(
|
||||||
(count.into_int_value(), offset.into_int_value())
|
(count.into_int_value(), offset.into_int_value())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_state<'a, 'ctx, 'env>(
|
fn write_state<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
count: IntValue<'ctx>,
|
count: IntValue<'ctx>,
|
||||||
offset: IntValue<'ctx>,
|
offset: IntValue<'ctx>,
|
||||||
|
@ -175,8 +175,8 @@ pub(crate) fn notify_parent_dbg(env: &Env, shared_memory: &SharedMemoryPointer)
|
||||||
// ..
|
// ..
|
||||||
// lookup_val_n (varsize)
|
// lookup_val_n (varsize)
|
||||||
//
|
//
|
||||||
pub(crate) fn clone_to_shared_memory<'a, 'ctx, 'env>(
|
pub(crate) fn clone_to_shared_memory<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
scope: &Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
|
@ -287,8 +287,8 @@ pub(crate) fn clone_to_shared_memory<'a, 'ctx, 'env>(
|
||||||
write_state(env, original_ptr, new_count, offset)
|
write_state(env, original_ptr, new_count, offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_clone<'a, 'ctx, 'env>(
|
fn build_clone<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
|
@ -417,8 +417,8 @@ fn build_clone<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_clone_struct<'a, 'ctx, 'env>(
|
fn build_clone_struct<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
|
@ -467,8 +467,8 @@ fn build_clone_struct<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_clone_tag<'a, 'ctx, 'env>(
|
fn build_clone_tag<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
|
@ -545,8 +545,8 @@ fn build_clone_tag<'a, 'ctx, 'env>(
|
||||||
result.into_int_value()
|
result.into_int_value()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_tag_data<'a, 'ctx, 'env>(
|
fn load_tag_data<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
union_layout: UnionLayout<'a>,
|
union_layout: UnionLayout<'a>,
|
||||||
tag_value: PointerValue<'ctx>,
|
tag_value: PointerValue<'ctx>,
|
||||||
|
@ -573,8 +573,8 @@ fn load_tag_data<'a, 'ctx, 'env>(
|
||||||
env.builder.new_build_load(tag_type, data_ptr, "load_data")
|
env.builder.new_build_load(tag_type, data_ptr, "load_data")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clone_tag_payload_and_id<'a, 'ctx, 'env>(
|
fn clone_tag_payload_and_id<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
|
@ -623,8 +623,8 @@ fn clone_tag_payload_and_id<'a, 'ctx, 'env>(
|
||||||
answer
|
answer
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_clone_tag_help<'a, 'ctx, 'env>(
|
fn build_clone_tag_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
union_layout: UnionLayout<'a>,
|
union_layout: UnionLayout<'a>,
|
||||||
|
@ -958,8 +958,8 @@ fn build_clone_tag_help<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_pointer_with_tag_id<'a, 'ctx, 'env>(
|
fn write_pointer_with_tag_id<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
offset: IntValue<'ctx>,
|
offset: IntValue<'ctx>,
|
||||||
extra_offset: IntValue<'ctx>,
|
extra_offset: IntValue<'ctx>,
|
||||||
|
@ -986,8 +986,8 @@ fn write_pointer_with_tag_id<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_copy<'a, 'ctx, 'env>(
|
fn build_copy<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
offset: IntValue<'ctx>,
|
offset: IntValue<'ctx>,
|
||||||
value: BasicValueEnum<'ctx>,
|
value: BasicValueEnum<'ctx>,
|
||||||
|
@ -1012,8 +1012,8 @@ fn build_copy<'a, 'ctx, 'env>(
|
||||||
env.builder.build_int_add(offset, width, "new_offset")
|
env.builder.build_int_add(offset, width, "new_offset")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_clone_builtin<'a, 'ctx, 'env>(
|
fn build_clone_builtin<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
ptr: PointerValue<'ctx>,
|
ptr: PointerValue<'ctx>,
|
||||||
|
|
|
@ -50,8 +50,8 @@ use super::{
|
||||||
convert::zig_dec_type,
|
convert::zig_dec_type,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(crate) fn run_low_level<'a, 'ctx, 'env>(
|
pub(crate) fn run_low_level<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
scope: &Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
|
@ -1271,8 +1271,8 @@ fn intwidth_from_layout(layout: InLayout) -> IntWidth {
|
||||||
layout.to_int_width()
|
layout.to_int_width()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_int_binop<'a, 'ctx, 'env>(
|
fn build_int_binop<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
int_width: IntWidth,
|
int_width: IntWidth,
|
||||||
lhs: IntValue<'ctx>,
|
lhs: IntValue<'ctx>,
|
||||||
|
@ -1492,8 +1492,8 @@ fn build_int_binop<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_num_binop<'a, 'ctx, 'env>(
|
pub fn build_num_binop<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &STLayoutInterner<'a>,
|
layout_interner: &STLayoutInterner<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
lhs_arg: BasicValueEnum<'ctx>,
|
lhs_arg: BasicValueEnum<'ctx>,
|
||||||
|
@ -1543,8 +1543,8 @@ pub fn build_num_binop<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_float_binop<'a, 'ctx, 'env>(
|
fn build_float_binop<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
float_width: FloatWidth,
|
float_width: FloatWidth,
|
||||||
lhs: FloatValue<'ctx>,
|
lhs: FloatValue<'ctx>,
|
||||||
rhs: FloatValue<'ctx>,
|
rhs: FloatValue<'ctx>,
|
||||||
|
@ -1656,8 +1656,8 @@ fn build_float_binop<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn throw_on_overflow<'a, 'ctx, 'env>(
|
fn throw_on_overflow<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
result: StructValue<'ctx>, // of the form { value: T, has_overflowed: bool }
|
result: StructValue<'ctx>, // of the form { value: T, has_overflowed: bool }
|
||||||
message: &str,
|
message: &str,
|
||||||
|
@ -1689,8 +1689,8 @@ fn throw_on_overflow<'a, 'ctx, 'env>(
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dec_split_into_words<'a, 'ctx, 'env>(
|
fn dec_split_into_words<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
value: IntValue<'ctx>,
|
value: IntValue<'ctx>,
|
||||||
) -> (IntValue<'ctx>, IntValue<'ctx>) {
|
) -> (IntValue<'ctx>, IntValue<'ctx>) {
|
||||||
let int_64 = env.context.i128_type().const_int(64, false);
|
let int_64 = env.context.i128_type().const_int(64, false);
|
||||||
|
@ -1706,10 +1706,7 @@ fn dec_split_into_words<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dec_alloca<'a, 'ctx, 'env>(
|
fn dec_alloca<'ctx>(env: &Env<'_, 'ctx, '_>, value: IntValue<'ctx>) -> PointerValue<'ctx> {
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
|
||||||
value: IntValue<'ctx>,
|
|
||||||
) -> PointerValue<'ctx> {
|
|
||||||
let dec_type = zig_dec_type(env);
|
let dec_type = zig_dec_type(env);
|
||||||
|
|
||||||
let alloca = env.builder.build_alloca(dec_type, "dec_alloca");
|
let alloca = env.builder.build_alloca(dec_type, "dec_alloca");
|
||||||
|
@ -1728,10 +1725,7 @@ fn dec_alloca<'a, 'ctx, 'env>(
|
||||||
alloca
|
alloca
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dec_to_str<'a, 'ctx, 'env>(
|
fn dec_to_str<'ctx>(env: &Env<'_, 'ctx, '_>, dec: BasicValueEnum<'ctx>) -> BasicValueEnum<'ctx> {
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
|
||||||
dec: BasicValueEnum<'ctx>,
|
|
||||||
) -> BasicValueEnum<'ctx> {
|
|
||||||
use roc_target::OperatingSystem::*;
|
use roc_target::OperatingSystem::*;
|
||||||
|
|
||||||
let dec = dec.into_int_value();
|
let dec = dec.into_int_value();
|
||||||
|
@ -1762,8 +1756,8 @@ fn dec_to_str<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dec_binop_with_overflow<'a, 'ctx, 'env>(
|
fn dec_binop_with_overflow<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
lhs: BasicValueEnum<'ctx>,
|
lhs: BasicValueEnum<'ctx>,
|
||||||
rhs: BasicValueEnum<'ctx>,
|
rhs: BasicValueEnum<'ctx>,
|
||||||
|
@ -1812,8 +1806,8 @@ fn dec_binop_with_overflow<'a, 'ctx, 'env>(
|
||||||
.into_struct_value()
|
.into_struct_value()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn dec_binop_with_unchecked<'a, 'ctx, 'env>(
|
pub(crate) fn dec_binop_with_unchecked<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
lhs: BasicValueEnum<'ctx>,
|
lhs: BasicValueEnum<'ctx>,
|
||||||
rhs: BasicValueEnum<'ctx>,
|
rhs: BasicValueEnum<'ctx>,
|
||||||
|
@ -1851,8 +1845,8 @@ pub(crate) fn dec_binop_with_unchecked<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_dec_binop<'a, 'ctx, 'env>(
|
fn build_dec_binop<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
lhs: BasicValueEnum<'ctx>,
|
lhs: BasicValueEnum<'ctx>,
|
||||||
_lhs_layout: InLayout<'a>,
|
_lhs_layout: InLayout<'a>,
|
||||||
|
@ -1897,8 +1891,8 @@ fn build_dec_binop<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_dec_binop_throw_on_overflow<'a, 'ctx, 'env>(
|
fn build_dec_binop_throw_on_overflow<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
operation: &str,
|
operation: &str,
|
||||||
lhs: BasicValueEnum<'ctx>,
|
lhs: BasicValueEnum<'ctx>,
|
||||||
|
@ -2128,8 +2122,8 @@ fn build_int_unary_op<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn int_neg_raise_on_overflow<'a, 'ctx, 'env>(
|
fn int_neg_raise_on_overflow<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
arg: IntValue<'ctx>,
|
arg: IntValue<'ctx>,
|
||||||
int_type: IntType<'ctx>,
|
int_type: IntType<'ctx>,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -2159,8 +2153,8 @@ fn int_neg_raise_on_overflow<'a, 'ctx, 'env>(
|
||||||
builder.build_int_neg(arg, "negate_int").into()
|
builder.build_int_neg(arg, "negate_int").into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn int_abs_raise_on_overflow<'a, 'ctx, 'env>(
|
fn int_abs_raise_on_overflow<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
arg: IntValue<'ctx>,
|
arg: IntValue<'ctx>,
|
||||||
int_type: IntType<'ctx>,
|
int_type: IntType<'ctx>,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -2190,8 +2184,8 @@ fn int_abs_raise_on_overflow<'a, 'ctx, 'env>(
|
||||||
int_abs_with_overflow(env, arg, int_type)
|
int_abs_with_overflow(env, arg, int_type)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn int_abs_with_overflow<'a, 'ctx, 'env>(
|
fn int_abs_with_overflow<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
arg: IntValue<'ctx>,
|
arg: IntValue<'ctx>,
|
||||||
int_type: IntType<'ctx>,
|
int_type: IntType<'ctx>,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
|
@ -2233,8 +2227,8 @@ fn int_abs_with_overflow<'a, 'ctx, 'env>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_float_unary_op<'a, 'ctx, 'env>(
|
fn build_float_unary_op<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &STLayoutInterner<'a>,
|
layout_interner: &STLayoutInterner<'a>,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
arg: FloatValue<'ctx>,
|
arg: FloatValue<'ctx>,
|
||||||
|
@ -2349,8 +2343,8 @@ fn build_float_unary_op<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn run_higher_order_low_level<'a, 'ctx, 'env>(
|
pub(crate) fn run_higher_order_low_level<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
scope: &Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
|
@ -2641,9 +2635,9 @@ pub(crate) fn run_higher_order_low_level<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_symbol_and_lambda_set<'a, 'ctx, 'b>(
|
fn load_symbol_and_lambda_set<'a, 'ctx>(
|
||||||
layout_interner: &STLayoutInterner<'a>,
|
layout_interner: &STLayoutInterner<'a>,
|
||||||
scope: &'b Scope<'a, 'ctx>,
|
scope: &Scope<'a, 'ctx>,
|
||||||
symbol: &Symbol,
|
symbol: &Symbol,
|
||||||
) -> (BasicValueEnum<'ctx>, LambdaSet<'a>) {
|
) -> (BasicValueEnum<'ctx>, LambdaSet<'a>) {
|
||||||
match scope.get(symbol).map(|(l, v)| (layout_interner.get(*l), v)) {
|
match scope.get(symbol).map(|(l, v)| (layout_interner.get(*l), v)) {
|
||||||
|
|
|
@ -195,8 +195,8 @@ impl<'ctx> PointerToRefcount<'ctx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn incref_pointer<'a, 'ctx, 'env>(
|
fn incref_pointer<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
pointer: PointerValue<'ctx>,
|
pointer: PointerValue<'ctx>,
|
||||||
amount: IntValue<'ctx>,
|
amount: IntValue<'ctx>,
|
||||||
) {
|
) {
|
||||||
|
@ -216,11 +216,7 @@ fn incref_pointer<'a, 'ctx, 'env>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn decref_pointer<'a, 'ctx, 'env>(
|
fn decref_pointer<'ctx>(env: &Env<'_, 'ctx, '_>, pointer: PointerValue<'ctx>, alignment: u32) {
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
|
||||||
pointer: PointerValue<'ctx>,
|
|
||||||
alignment: u32,
|
|
||||||
) {
|
|
||||||
let alignment = env.context.i32_type().const_int(alignment as _, false);
|
let alignment = env.context.i32_type().const_int(alignment as _, false);
|
||||||
call_void_bitcode_fn(
|
call_void_bitcode_fn(
|
||||||
env,
|
env,
|
||||||
|
@ -239,8 +235,8 @@ fn decref_pointer<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Assumes a pointer to the refcount
|
/// Assumes a pointer to the refcount
|
||||||
pub fn decref_pointer_check_null<'a, 'ctx, 'env>(
|
pub fn decref_pointer_check_null<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
pointer: PointerValue<'ctx>,
|
pointer: PointerValue<'ctx>,
|
||||||
alignment: u32,
|
alignment: u32,
|
||||||
) {
|
) {
|
||||||
|
@ -261,8 +257,8 @@ pub fn decref_pointer_check_null<'a, 'ctx, 'env>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_struct<'a, 'ctx, 'env>(
|
fn modify_refcount_struct<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
layouts: &'a [InLayout<'a>],
|
layouts: &'a [InLayout<'a>],
|
||||||
|
@ -308,8 +304,8 @@ fn modify_refcount_struct<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn modify_refcount_struct_help<'a, 'ctx, 'env>(
|
fn modify_refcount_struct_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -363,8 +359,8 @@ fn modify_refcount_struct_help<'a, 'ctx, 'env>(
|
||||||
builder.build_return(None);
|
builder.build_return(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn increment_refcount_layout<'a, 'ctx, 'env>(
|
pub fn increment_refcount_layout<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
inc_amount: u64,
|
inc_amount: u64,
|
||||||
|
@ -375,8 +371,8 @@ pub fn increment_refcount_layout<'a, 'ctx, 'env>(
|
||||||
increment_n_refcount_layout(env, layout_interner, layout_ids, amount, value, layout);
|
increment_n_refcount_layout(env, layout_interner, layout_ids, amount, value, layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn increment_n_refcount_layout<'a, 'ctx, 'env>(
|
pub fn increment_n_refcount_layout<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
amount: IntValue<'ctx>,
|
amount: IntValue<'ctx>,
|
||||||
|
@ -393,8 +389,8 @@ pub fn increment_n_refcount_layout<'a, 'ctx, 'env>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn decrement_refcount_layout<'a, 'ctx, 'env>(
|
pub fn decrement_refcount_layout<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
value: BasicValueEnum<'ctx>,
|
value: BasicValueEnum<'ctx>,
|
||||||
|
@ -410,8 +406,8 @@ pub fn decrement_refcount_layout<'a, 'ctx, 'env>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_builtin<'a, 'ctx, 'env>(
|
fn modify_refcount_builtin<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -443,8 +439,8 @@ fn modify_refcount_builtin<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_layout<'a, 'ctx, 'env>(
|
fn modify_refcount_layout<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
call_mode: CallMode<'ctx>,
|
call_mode: CallMode<'ctx>,
|
||||||
|
@ -454,8 +450,8 @@ fn modify_refcount_layout<'a, 'ctx, 'env>(
|
||||||
modify_refcount_layout_help(env, layout_interner, layout_ids, call_mode, value, layout);
|
modify_refcount_layout_help(env, layout_interner, layout_ids, call_mode, value, layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_layout_help<'a, 'ctx, 'env>(
|
fn modify_refcount_layout_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
call_mode: CallMode<'ctx>,
|
call_mode: CallMode<'ctx>,
|
||||||
|
@ -495,8 +491,8 @@ fn modify_refcount_layout_help<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call_help<'a, 'ctx, 'env>(
|
fn call_help<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
function: FunctionValue<'ctx>,
|
function: FunctionValue<'ctx>,
|
||||||
call_mode: CallMode<'ctx>,
|
call_mode: CallMode<'ctx>,
|
||||||
value: BasicValueEnum<'ctx>,
|
value: BasicValueEnum<'ctx>,
|
||||||
|
@ -522,8 +518,8 @@ fn call_help<'a, 'ctx, 'env>(
|
||||||
call
|
call
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_layout_build_function<'a, 'ctx, 'env>(
|
fn modify_refcount_layout_build_function<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -596,8 +592,8 @@ fn modify_refcount_layout_build_function<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_list<'a, 'ctx, 'env>(
|
fn modify_refcount_list<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -656,8 +652,8 @@ fn mode_to_call_mode(function: FunctionValue<'_>, mode: Mode) -> CallMode<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_list_help<'a, 'ctx, 'env>(
|
fn modify_refcount_list_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -744,8 +740,8 @@ fn modify_refcount_list_help<'a, 'ctx, 'env>(
|
||||||
builder.build_return(None);
|
builder.build_return(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_str<'a, 'ctx, 'env>(
|
fn modify_refcount_str<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -781,8 +777,8 @@ fn modify_refcount_str<'a, 'ctx, 'env>(
|
||||||
function
|
function
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_str_help<'a, 'ctx, 'env>(
|
fn modify_refcount_str_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
layout: InLayout<'a>,
|
layout: InLayout<'a>,
|
||||||
|
@ -851,8 +847,8 @@ fn modify_refcount_str_help<'a, 'ctx, 'env>(
|
||||||
builder.build_return(None);
|
builder.build_return(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_boxed<'a, 'ctx, 'env>(
|
fn modify_refcount_boxed<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -890,8 +886,8 @@ fn modify_refcount_boxed<'a, 'ctx, 'env>(
|
||||||
function
|
function
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_box_help<'a, 'ctx, 'env>(
|
fn modify_refcount_box_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
inner_layout: InLayout<'a>,
|
inner_layout: InLayout<'a>,
|
||||||
|
@ -923,8 +919,8 @@ fn modify_refcount_box_help<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build an increment or decrement function for a specific layout
|
/// Build an increment or decrement function for a specific layout
|
||||||
fn build_header<'a, 'ctx, 'env>(
|
fn build_header<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
arg_type: BasicTypeEnum<'ctx>,
|
arg_type: BasicTypeEnum<'ctx>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
|
@ -941,8 +937,8 @@ fn build_header<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build an increment or decrement function for a specific layout
|
/// Build an increment or decrement function for a specific layout
|
||||||
pub fn build_header_help<'a, 'ctx, 'env>(
|
pub fn build_header_help<'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'_, 'ctx, '_>,
|
||||||
fn_name: &str,
|
fn_name: &str,
|
||||||
return_type: AnyTypeEnum<'ctx>,
|
return_type: AnyTypeEnum<'ctx>,
|
||||||
arguments: &[BasicTypeEnum<'ctx>],
|
arguments: &[BasicTypeEnum<'ctx>],
|
||||||
|
@ -1013,8 +1009,8 @@ enum CallMode<'ctx> {
|
||||||
Dec,
|
Dec,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_rec_union<'a, 'ctx, 'env>(
|
fn build_rec_union<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -1060,8 +1056,8 @@ fn build_rec_union<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn build_rec_union_help<'a, 'ctx, 'env>(
|
fn build_rec_union_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -1184,8 +1180,8 @@ fn fields_need_no_refcounting(interner: &STLayoutInterner, field_layouts: &[InLa
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn build_rec_union_recursive_decrement<'a, 'ctx, 'env>(
|
fn build_rec_union_recursive_decrement<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
parent: FunctionValue<'ctx>,
|
parent: FunctionValue<'ctx>,
|
||||||
|
@ -1414,8 +1410,8 @@ fn union_layout_tags<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_reset<'a, 'ctx, 'env>(
|
pub fn build_reset<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
union_layout: UnionLayout<'a>,
|
union_layout: UnionLayout<'a>,
|
||||||
|
@ -1458,8 +1454,8 @@ pub fn build_reset<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn build_reuse_rec_union_help<'a, 'ctx, 'env>(
|
fn build_reuse_rec_union_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
union_layout: UnionLayout<'a>,
|
union_layout: UnionLayout<'a>,
|
||||||
|
@ -1572,8 +1568,8 @@ fn function_name_from_mode<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_nonrecursive<'a, 'ctx, 'env>(
|
fn modify_refcount_nonrecursive<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
@ -1619,8 +1615,8 @@ fn modify_refcount_nonrecursive<'a, 'ctx, 'env>(
|
||||||
function
|
function
|
||||||
}
|
}
|
||||||
|
|
||||||
fn modify_refcount_nonrecursive_help<'a, 'ctx, 'env>(
|
fn modify_refcount_nonrecursive_help<'a, 'ctx>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, '_>,
|
||||||
layout_interner: &mut STLayoutInterner<'a>,
|
layout_interner: &mut STLayoutInterner<'a>,
|
||||||
layout_ids: &mut LayoutIds<'a>,
|
layout_ids: &mut LayoutIds<'a>,
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
|
|
|
@ -63,7 +63,6 @@ pub fn pretty_print_ir_symbols() -> bool {
|
||||||
// if your changes cause this number to go down, great!
|
// if your changes cause this number to go down, great!
|
||||||
// please change it to the lower number.
|
// please change it to the lower number.
|
||||||
// if it went up, maybe check that the change is really required
|
// if it went up, maybe check that the change is really required
|
||||||
|
|
||||||
roc_error_macros::assert_sizeof_wasm!(Literal, 24);
|
roc_error_macros::assert_sizeof_wasm!(Literal, 24);
|
||||||
roc_error_macros::assert_sizeof_wasm!(Expr, 48);
|
roc_error_macros::assert_sizeof_wasm!(Expr, 48);
|
||||||
roc_error_macros::assert_sizeof_wasm!(Stmt, 64);
|
roc_error_macros::assert_sizeof_wasm!(Stmt, 64);
|
||||||
|
|
|
@ -1193,7 +1193,7 @@ fn extract<'a>(
|
||||||
|
|
||||||
/// FIND IRRELEVANT BRANCHES
|
/// FIND IRRELEVANT BRANCHES
|
||||||
|
|
||||||
fn is_irrelevant_to(selected_path: &[PathInstruction], branch: &Branch<'_>) -> bool {
|
fn is_irrelevant_to(selected_path: &[PathInstruction], branch: &Branch) -> bool {
|
||||||
match branch
|
match branch
|
||||||
.patterns
|
.patterns
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -1358,7 +1358,7 @@ fn small_branching_factor(branches: &[Branch], path: &[PathInstruction]) -> usiz
|
||||||
branches.iter().any(|b| is_irrelevant_to(path, b))
|
branches.iter().any(|b| is_irrelevant_to(path, b))
|
||||||
};
|
};
|
||||||
|
|
||||||
relevant_tests.len() + (if !fallbacks { 0 } else { 1 })
|
relevant_tests.len() + usize::from(fallbacks)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
|
|
|
@ -545,7 +545,7 @@ fn compact_lambda_set<P: Phase>(
|
||||||
Err(()) => {
|
Err(()) => {
|
||||||
// Do nothing other than to remove the concrete lambda to drop from the lambda set,
|
// Do nothing other than to remove the concrete lambda to drop from the lambda set,
|
||||||
// which we already did in 1b above.
|
// which we already did in 1b above.
|
||||||
trace_compact!(3iter_end_skipped. subs, t_f1);
|
trace_compact!(3iter_end_skipped.subs, t_f1);
|
||||||
return OneCompactionResult::Compacted {
|
return OneCompactionResult::Compacted {
|
||||||
new_obligations: Default::default(),
|
new_obligations: Default::default(),
|
||||||
new_lambda_sets_to_specialize: Default::default(),
|
new_lambda_sets_to_specialize: Default::default(),
|
||||||
|
@ -568,7 +568,7 @@ fn compact_lambda_set<P: Phase>(
|
||||||
Err(()) => {
|
Err(()) => {
|
||||||
// Do nothing other than to remove the concrete lambda to drop from the lambda set,
|
// Do nothing other than to remove the concrete lambda to drop from the lambda set,
|
||||||
// which we already did in 1b above.
|
// which we already did in 1b above.
|
||||||
trace_compact!(3iter_end_skipped. subs, t_f1);
|
trace_compact!(3iter_end_skipped.subs, t_f1);
|
||||||
return OneCompactionResult::Compacted {
|
return OneCompactionResult::Compacted {
|
||||||
new_obligations: Default::default(),
|
new_obligations: Default::default(),
|
||||||
new_lambda_sets_to_specialize: Default::default(),
|
new_lambda_sets_to_specialize: Default::default(),
|
||||||
|
@ -581,7 +581,7 @@ fn compact_lambda_set<P: Phase>(
|
||||||
let t_f2 = deep_copy_var_in(subs, target_rank, pools, t_f2, arena);
|
let t_f2 = deep_copy_var_in(subs, target_rank, pools, t_f2, arena);
|
||||||
|
|
||||||
// 3. Unify `t_f1 ~ t_f2`.
|
// 3. Unify `t_f1 ~ t_f2`.
|
||||||
trace_compact!(3iter_start. subs, this_lambda_set, t_f1, t_f2);
|
trace_compact!(3iter_start.subs, this_lambda_set, t_f1, t_f2);
|
||||||
let (vars, new_obligations, new_lambda_sets_to_specialize, _meta) = unify(
|
let (vars, new_obligations, new_lambda_sets_to_specialize, _meta) = unify(
|
||||||
&mut UEnv::new(subs),
|
&mut UEnv::new(subs),
|
||||||
t_f1,
|
t_f1,
|
||||||
|
@ -590,7 +590,7 @@ fn compact_lambda_set<P: Phase>(
|
||||||
Polarity::Pos,
|
Polarity::Pos,
|
||||||
)
|
)
|
||||||
.expect_success("ambient functions don't unify");
|
.expect_success("ambient functions don't unify");
|
||||||
trace_compact!(3iter_end. subs, t_f1);
|
trace_compact!(3iter_end.subs, t_f1);
|
||||||
|
|
||||||
introduce(subs, target_rank, pools, &vars);
|
introduce(subs, target_rank, pools, &vars);
|
||||||
|
|
||||||
|
|
|
@ -544,9 +544,9 @@ mod test_snapshots {
|
||||||
let mut parent = std::path::PathBuf::from("tests");
|
let mut parent = std::path::PathBuf::from("tests");
|
||||||
parent.push("snapshots");
|
parent.push("snapshots");
|
||||||
parent.push(expect.to_dir_name());
|
parent.push(expect.to_dir_name());
|
||||||
let input_path = parent.join(&format!("{}.{}.roc", name, ty));
|
let input_path = parent.join(format!("{}.{}.roc", name, ty));
|
||||||
let result_path = parent.join(&format!("{}.{}.result-ast", name, ty));
|
let result_path = parent.join(format!("{}.{}.result-ast", name, ty));
|
||||||
let formatted_path = parent.join(&format!("{}.{}.formatted.roc", name, ty));
|
let formatted_path = parent.join(format!("{}.{}.formatted.roc", name, ty));
|
||||||
|
|
||||||
let source = std::fs::read_to_string(&input_path).unwrap_or_else(|err| {
|
let source = std::fs::read_to_string(&input_path).unwrap_or_else(|err| {
|
||||||
panic!(
|
panic!(
|
||||||
|
|
|
@ -6,9 +6,10 @@
|
||||||
, pkgs ? import nixpkgsSource { }
|
, pkgs ? import nixpkgsSource { }
|
||||||
,
|
,
|
||||||
}:
|
}:
|
||||||
# we only this file to release a nix package, use flake.nix for development
|
# we only use this file to release a nix package, use flake.nix for development
|
||||||
let
|
let
|
||||||
rustPlatform = pkgs.rustPlatform;
|
rustPlatform = pkgs.rustPlatform;
|
||||||
|
|
||||||
llvmPkgs = pkgs.llvmPackages_13;
|
llvmPkgs = pkgs.llvmPackages_13;
|
||||||
# nix does not store libs in /usr/lib or /lib
|
# nix does not store libs in /usr/lib or /lib
|
||||||
nixGlibcPath = if pkgs.stdenv.isLinux then "${pkgs.glibc.out}/lib" else "";
|
nixGlibcPath = if pkgs.stdenv.isLinux then "${pkgs.glibc.out}/lib" else "";
|
||||||
|
@ -23,7 +24,7 @@ rustPlatform.buildRustPackage {
|
||||||
lockFile = ./Cargo.lock;
|
lockFile = ./Cargo.lock;
|
||||||
outputHashes = {
|
outputHashes = {
|
||||||
"confy-0.5.1" = "sha256-3PQdz9W/uJd4CaUZdwAd2u3JJ100SFAoKLCFE6THRZI=";
|
"confy-0.5.1" = "sha256-3PQdz9W/uJd4CaUZdwAd2u3JJ100SFAoKLCFE6THRZI=";
|
||||||
"criterion-0.3.5" = "sha256-7REd3phV6PBzqWwKF8hwttw4FTq2tKGxxAAJDpLC50A=";
|
"criterion-0.3.5" = "sha256-+FibPQGiR45g28xCHcM0pMN+C+Q8gO8206Wb5fiTy+k=";
|
||||||
"inkwell-0.1.0" = "sha256-1kpvY3naS33B99nuu5ZYhb7mdddAyG+DkbUl/RG1Ptg=";
|
"inkwell-0.1.0" = "sha256-1kpvY3naS33B99nuu5ZYhb7mdddAyG+DkbUl/RG1Ptg=";
|
||||||
"plotters-0.3.1" = "sha256-noy/RSjoEPZZbOJTZw1yxGcX5S+2q/7mxnUrzDyxOFw=";
|
"plotters-0.3.1" = "sha256-noy/RSjoEPZZbOJTZw1yxGcX5S+2q/7mxnUrzDyxOFw=";
|
||||||
"rustyline-9.1.1" = "sha256-aqQqz6nSp+Qn44gm3jXmmQUO6/fYTx7iLph2tbA24Bs=";
|
"rustyline-9.1.1" = "sha256-aqQqz6nSp+Qn44gm3jXmmQUO6/fYTx7iLph2tbA24Bs=";
|
||||||
|
|
|
@ -10,7 +10,7 @@ Further steps:
|
||||||
1. Copy the flake.nix and flake.lock file to a new folder outside of the roc repo folder.
|
1. Copy the flake.nix and flake.lock file to a new folder outside of the roc repo folder.
|
||||||
1. Run `git init` in the new folder.
|
1. Run `git init` in the new folder.
|
||||||
1. Execute `git add flake.nix`, nix will error if you don't do this.
|
1. Execute `git add flake.nix`, nix will error if you don't do this.
|
||||||
1. Change `roc.url = "path:/home/username/gitrepos/roc1/roc";` to the location of the roc folder on your machine.
|
1. Change `roc.url = "path:/home/username/gitrepos/roc9/roc";` to the location of the roc folder on your machine.
|
||||||
1. Follow instructions about vscode extensions [here](#extensions).
|
1. Follow instructions about vscode extensions [here](#extensions).
|
||||||
1. add other dev tools you like in the `devInputs` list. You can search for those [here](https://search.nixos.org/packages).
|
1. add other dev tools you like in the `devInputs` list. You can search for those [here](https://search.nixos.org/packages).
|
||||||
1. Run `nix develop`.
|
1. Run `nix develop`.
|
||||||
|
|
100
devtools/flake.lock
generated
100
devtools/flake.lock
generated
|
@ -1,12 +1,15 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1681202837,
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -16,12 +19,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
"flake-utils_2": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_2"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1681202837,
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -46,12 +52,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_4": {
|
"flake-utils_4": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_3"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659877975,
|
"lastModified": 1681202837,
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -69,11 +78,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672992692,
|
"lastModified": 1676383589,
|
||||||
"narHash": "sha256-/eLQLSNIa22ARTZbk+x8i0iE8khe1eiHWkuxgTVXZ7g=",
|
"narHash": "sha256-KCkWZXCjH+C4Kn7fUGSrEl5btk+sERHhZueSsvVbPWc=",
|
||||||
"owner": "guibou",
|
"owner": "guibou",
|
||||||
"repo": "nixGL",
|
"repo": "nixGL",
|
||||||
"rev": "643e730efb981ffaf8478f441ec9b9aeea1c89f5",
|
"rev": "c917918ab9ebeee27b0dd657263d3f57ba6bb8ad",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -84,17 +93,17 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673134516,
|
"lastModified": 1674860021,
|
||||||
"narHash": "sha256-mAZQKqkNQbBmJnmUU0blOfkKlgMSSVyPHdeWeuKad8U=",
|
"narHash": "sha256-ES4XUf/AlPp8RetKR6WlWgYEZ7bLWI7k6reHp2q9rqY=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f6f44561884c3470e2b783683d5dbac42dfc833b",
|
"rev": "9f4346eac544cc0db5eb7d889e71eac0f9c8b9eb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
|
"rev": "9f4346eac544cc0db5eb7d889e71eac0f9c8b9eb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -106,13 +115,13 @@
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673266343,
|
"lastModified": 1682761608,
|
||||||
"narHash": "sha256-HQGjNhCte1wgvo5/SUL1OjIpfoUCQ8vC/2k0gi7UtmQ=",
|
"narHash": "sha256-+6tHbEK8GYDSCLasgawufSLegyJ0cqHV2nfmJICwzrk=",
|
||||||
"path": "/home/username/gitrepos/roc1/roc",
|
"path": "/home/username/gitrepos/roc9/roc",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/home/username/gitrepos/roc1/roc",
|
"path": "/home/username/gitrepos/roc9/roc",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -131,11 +140,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673231106,
|
"lastModified": 1682389182,
|
||||||
"narHash": "sha256-Tbw4N/TL+nHmxF8RBoOJbl/6DRRzado/9/ttPEzkGr8=",
|
"narHash": "sha256-8t2nmFnH+8V48+IJsf8AK51ebXNlVbOSVYOpiqJKvJE=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "3488cec01351c2f1086b02a3a61808be7a25103e",
|
"rev": "74f1a64dd28faeeb85ef081f32cad2989850322c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -143,6 +152,51 @@
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
description = "Allows sharing dependencies between dev tools and roc";
|
description = "Allows sharing dependencies between dev tools and roc. Prevents version GLIBC_2.36 not found.";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
# change this path to the path of your roc folder
|
# change this path to the path of your roc folder
|
||||||
roc.url = "path:/home/username/gitrepos/roc1/roc";
|
roc.url = "path:/home/username/gitrepos/roc9/roc";
|
||||||
# to easily make configs for multiple architectures
|
# to easily make configs for multiple architectures
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
vscodeWithExtensions = pkgs.vscode-with-extensions.override {
|
vscodeWithExtensions = pkgs.vscode-with-extensions.override {
|
||||||
vscodeExtensions = with pkgs.vscode-extensions; [
|
vscodeExtensions = with pkgs.vscode-extensions; [
|
||||||
matklad.rust-analyzer
|
matklad.rust-analyzer
|
||||||
eamodio.gitlens
|
# eamodio.gitlens
|
||||||
bbenoist.nix
|
bbenoist.nix
|
||||||
vadimcn.vscode-lldb
|
vadimcn.vscode-lldb
|
||||||
tamasfe.even-better-toml
|
tamasfe.even-better-toml
|
||||||
|
@ -33,13 +33,12 @@
|
||||||
{
|
{
|
||||||
name = "roc-lang-support";
|
name = "roc-lang-support";
|
||||||
publisher = "benjamin-thomas";
|
publisher = "benjamin-thomas";
|
||||||
version = "0.0.3";
|
version = "0.0.4";
|
||||||
# keep this sha for the first run, nix will tell you the correct one to change it to
|
# keep this sha for the first run, nix will tell you the correct one to change it to
|
||||||
sha256 = "sha256-mabNegZ+XPQ6EIHFk6jz2mAPLHAU6Pm3w0SiFB7IE+s=";
|
sha256 = "sha256-mabNegZ+XPQ6EIHFk6jz2mAPLHAU6Pm3w0SiFB7IE+s=";
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
;
|
;
|
||||||
|
|
||||||
};
|
};
|
||||||
in [ vscodeWithExtensions devInputs ];
|
in [ vscodeWithExtensions devInputs ];
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.65.0"
|
channel = "1.66.1"
|
||||||
|
|
||||||
profile = "default"
|
profile = "default"
|
||||||
|
|
||||||
|
|
68
flake.lock
generated
68
flake.lock
generated
|
@ -1,12 +1,15 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1681202837,
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -31,12 +34,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_3": {
|
"flake-utils_3": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_2"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659877975,
|
"lastModified": 1681202837,
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -53,11 +59,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1672992692,
|
"lastModified": 1676383589,
|
||||||
"narHash": "sha256-/eLQLSNIa22ARTZbk+x8i0iE8khe1eiHWkuxgTVXZ7g=",
|
"narHash": "sha256-KCkWZXCjH+C4Kn7fUGSrEl5btk+sERHhZueSsvVbPWc=",
|
||||||
"owner": "guibou",
|
"owner": "guibou",
|
||||||
"repo": "nixGL",
|
"repo": "nixGL",
|
||||||
"rev": "643e730efb981ffaf8478f441ec9b9aeea1c89f5",
|
"rev": "c917918ab9ebeee27b0dd657263d3f57ba6bb8ad",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -68,17 +74,17 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673796341,
|
"lastModified": 1674860021,
|
||||||
"narHash": "sha256-1kZi9OkukpNmOaPY7S5/+SlCDOuYnP3HkXHvNDyLQcc=",
|
"narHash": "sha256-ES4XUf/AlPp8RetKR6WlWgYEZ7bLWI7k6reHp2q9rqY=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6dccdc458512abce8d19f74195bb20fdb067df50",
|
"rev": "9f4346eac544cc0db5eb7d889e71eac0f9c8b9eb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
|
"rev": "9f4346eac544cc0db5eb7d889e71eac0f9c8b9eb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -98,11 +104,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673922364,
|
"lastModified": 1682389182,
|
||||||
"narHash": "sha256-U0XIY/Y/x4fFtlCZKMtWlqOYUnLiXj4F42GQHxWuPow=",
|
"narHash": "sha256-8t2nmFnH+8V48+IJsf8AK51ebXNlVbOSVYOpiqJKvJE=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "4e0f9b8a5102387f8d19901bced16a256a6ccdc7",
|
"rev": "74f1a64dd28faeeb85ef081f32cad2989850322c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -110,6 +116,36 @@
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
description = "Roc flake";
|
description = "Roc flake";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?rev=9f4346eac544cc0db5eb7d889e71eac0f9c8b9eb";
|
||||||
|
|
||||||
# rust from nixpkgs has some libc problems, this is patched in the rust-overlay
|
# rust from nixpkgs has some libc problems, this is patched in the rust-overlay
|
||||||
rust-overlay = {
|
rust-overlay = {
|
||||||
|
|
|
@ -3,14 +3,15 @@
|
||||||
# - update `channel = "RUST_VERSION"`
|
# - update `channel = "RUST_VERSION"`
|
||||||
# - update `channel = "RUST_VERSION"` in examples/platform-switching/rust-platform/rust-toolchain.toml
|
# - update `channel = "RUST_VERSION"` in examples/platform-switching/rust-platform/rust-toolchain.toml
|
||||||
# - to update the nightly version:
|
# - to update the nightly version:
|
||||||
# - Find the latest nightly release that matches RUST_VERSION here: https://github.com/oxalica/rust-overlay/tree/master/manifests/nightly/2022
|
# - Find the latest nightly release that matches RUST_VERSION here: https://github.com/oxalica/rust-overlay/tree/master/manifests/nightly/2023
|
||||||
# - update `channel = "nightly-OLD_DATE"` below
|
# - update `channel = "nightly-OLD_DATE"` below
|
||||||
# - update nightly-OLD_DATE in .github/workflows/windows.yml
|
# - update nightly-OLD_DATE in .github/workflows/windows_tests.yml
|
||||||
|
# - update nightly-OLD_DATE in .github/workflows/windows_release_build.yml
|
||||||
# - update nightly-OLD_DATE in crates/compiler/build/src/link.rs
|
# - update nightly-OLD_DATE in crates/compiler/build/src/link.rs
|
||||||
|
|
||||||
channel = "1.65.0" # check ^^^ when changing this
|
channel = "1.66.1" # check ^^^ when changing this
|
||||||
#
|
#
|
||||||
# channel = "nightly-2022-09-17" # 1.65 nightly to be able to use unstable features
|
# channel = "nightly-2022-10-30" # 1.66.0 nightly to be able to use unstable features
|
||||||
profile = "default"
|
profile = "default"
|
||||||
components = [
|
components = [
|
||||||
# for usages of rust-analyzer or similar tools inside `nix develop`
|
# for usages of rust-analyzer or similar tools inside `nix develop`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue