mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Merge branch 'main' into symbol_tags
Signed-off-by: J Teeuwissen <jelleteeuwissen@hotmail.nl>
This commit is contained in:
commit
7710170e68
190 changed files with 2563 additions and 1933 deletions
|
@ -25,9 +25,9 @@ use crate::{
|
|||
/**
|
||||
Insert the reference count operations for procedures.
|
||||
*/
|
||||
pub fn insert_inc_dec_operations<'a, 'i>(
|
||||
pub fn insert_inc_dec_operations<'a>(
|
||||
arena: &'a Bump,
|
||||
layout_interner: &'i STLayoutInterner<'a>,
|
||||
layout_interner: &STLayoutInterner<'a>,
|
||||
procedures: &mut HashMap<(Symbol, ProcLayout), Proc<'a>, BuildHasherDefault<WyHash>>,
|
||||
) {
|
||||
// Create a SymbolRcTypesEnv for the procedures as they get referenced but should be marked as non reference counted.
|
||||
|
@ -401,9 +401,9 @@ impl<'v> RefcountEnvironment<'v> {
|
|||
/**
|
||||
Insert the reference counting operations into a statement.
|
||||
*/
|
||||
fn insert_inc_dec_operations_proc<'a, 'i>(
|
||||
fn insert_inc_dec_operations_proc<'a>(
|
||||
arena: &'a Bump,
|
||||
mut symbol_rc_types_env: SymbolRcTypesEnv<'a, 'i>,
|
||||
mut symbol_rc_types_env: SymbolRcTypesEnv<'a, '_>,
|
||||
proc: &mut Proc<'a>,
|
||||
) {
|
||||
// Clone the symbol_rc_types_env and insert the symbols in the current procedure.
|
||||
|
|
|
@ -279,8 +279,9 @@ impl AbilityAliases {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
|
||||
pub enum CapturedSymbols<'a> {
|
||||
#[default]
|
||||
None,
|
||||
Captured(&'a [(Symbol, Variable)]),
|
||||
}
|
||||
|
@ -294,12 +295,6 @@ impl<'a> CapturedSymbols<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Default for CapturedSymbols<'a> {
|
||||
fn default() -> Self {
|
||||
CapturedSymbols::None
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct Proc<'a> {
|
||||
pub name: LambdaName<'a>,
|
||||
|
@ -2722,8 +2717,8 @@ fn patterns_to_when<'a>(
|
|||
/// { x } -> body
|
||||
///
|
||||
/// conversion of one-pattern when expressions will do the most optimal thing
|
||||
fn pattern_to_when<'a>(
|
||||
env: &mut Env<'a, '_>,
|
||||
fn pattern_to_when(
|
||||
env: &mut Env<'_, '_>,
|
||||
pattern_var: Variable,
|
||||
pattern: Loc<roc_can::pattern::Pattern>,
|
||||
body_var: Variable,
|
||||
|
@ -5740,8 +5735,8 @@ fn compile_struct_like<'a, L, UnusedLayout>(
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn late_resolve_ability_specialization<'a>(
|
||||
env: &mut Env<'a, '_>,
|
||||
fn late_resolve_ability_specialization(
|
||||
env: &mut Env<'_, '_>,
|
||||
member: Symbol,
|
||||
specialization_id: Option<SpecializationId>,
|
||||
specialization_var: Variable,
|
||||
|
|
|
@ -1193,7 +1193,7 @@ fn extract<'a>(
|
|||
|
||||
/// FIND IRRELEVANT BRANCHES
|
||||
|
||||
fn is_irrelevant_to<'a>(selected_path: &[PathInstruction], branch: &Branch<'a>) -> bool {
|
||||
fn is_irrelevant_to(selected_path: &[PathInstruction], branch: &Branch<'_>) -> bool {
|
||||
match branch
|
||||
.patterns
|
||||
.iter()
|
||||
|
@ -1720,7 +1720,7 @@ fn test_to_comparison<'a>(
|
|||
|
||||
Test::IsFloat(test_int, precision) => {
|
||||
// TODO maybe we can actually use i64 comparison here?
|
||||
let test_float = f64::from_bits(test_int as u64);
|
||||
let test_float = f64::from_bits(test_int);
|
||||
let lhs = Expr::Literal(Literal::Float(test_float));
|
||||
let lhs_symbol = env.unique_symbol();
|
||||
stores.push((lhs_symbol, Layout::float_width(precision), lhs));
|
||||
|
@ -2240,7 +2240,7 @@ fn decide_to_branching<'a>(
|
|||
|
||||
let tag = match test {
|
||||
Test::IsInt(v, _) => i128::from_ne_bytes(v) as u64,
|
||||
Test::IsFloat(v, _) => v as u64,
|
||||
Test::IsFloat(v, _) => v,
|
||||
Test::IsBit(v) => v as u64,
|
||||
Test::IsByte { tag_id, .. } => tag_id as u64,
|
||||
Test::IsCtor { tag_id, .. } => tag_id as u64,
|
||||
|
|
|
@ -457,7 +457,7 @@ macro_rules! cached {
|
|||
}
|
||||
|
||||
pub type TagIdIntType = u16;
|
||||
pub const MAX_ENUM_SIZE: usize = (std::mem::size_of::<TagIdIntType>() * 8) as usize;
|
||||
pub const MAX_ENUM_SIZE: usize = std::mem::size_of::<TagIdIntType>() * 8;
|
||||
const GENERATE_NULLABLE: bool = true;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
@ -898,7 +898,7 @@ impl<'a> UnionLayout<'a> {
|
|||
} => {
|
||||
debug_assert_ne!(nullable_id, tag_id != 0);
|
||||
|
||||
other_fields[index as usize]
|
||||
other_fields[index]
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ macro_rules! cache_interned_layouts {
|
|||
)*
|
||||
}
|
||||
|
||||
fn fill_reserved_layouts<'a>(interner: &mut STLayoutInterner<'a>) {
|
||||
fn fill_reserved_layouts(interner: &mut STLayoutInterner<'_>) {
|
||||
assert!(interner.is_empty());
|
||||
$(
|
||||
interner.insert($layout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue