Merge remote-tracking branch 'upstream/main' into rust-docs

This commit is contained in:
Luke Boswell 2022-11-06 09:15:57 +11:00
commit 2c2a70b8e7
132 changed files with 1819 additions and 1795 deletions

View file

@ -471,7 +471,7 @@ impl<'a> CodeGenHelp<'a> {
) -> (bool, Vec<'a, Option<usize>>) {
use UnionLayout::*;
match union {
NonRecursive(_) => return (false, bumpalo::vec![in self.arena]),
NonRecursive(_) => (false, bumpalo::vec![in self.arena]),
Recursive(tags) => self.union_tail_recursion_fields_help(tags),

View file

@ -284,7 +284,7 @@ impl AbilityAliases {
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CapturedSymbols<'a> {
None,
Captured(&'a [(Symbol, Variable)]),
@ -317,7 +317,7 @@ pub struct Proc<'a> {
pub host_exposed_layouts: HostExposedLayouts<'a>,
}
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum HostExposedLayouts<'a> {
NotHostExposed,
HostExposed {
@ -326,13 +326,13 @@ pub enum HostExposedLayouts<'a> {
},
}
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum SelfRecursive {
NotSelfRecursive,
SelfRecursive(JoinPointId),
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Parens {
NotNeeded,
InTypeParam,
@ -1575,7 +1575,7 @@ impl<'a, 'i> Env<'a, 'i> {
#[derive(Clone, Debug, PartialEq, Copy, Eq, Hash)]
pub struct JoinPointId(pub Symbol);
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Param<'a> {
pub symbol: Symbol,
pub borrow: bool,
@ -1659,7 +1659,7 @@ pub enum Stmt<'a> {
}
/// in the block below, symbol `scrutinee` is assumed be be of shape `tag_id`
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum BranchInfo<'a> {
None,
Constructor {
@ -1702,7 +1702,7 @@ impl<'a> BranchInfo<'a> {
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ModifyRc {
/// Increment a reference count
Inc(Symbol, u64),
@ -1848,7 +1848,7 @@ impl<'a> Call<'a> {
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct CallSpecId {
id: u32,
}
@ -1863,7 +1863,7 @@ impl CallSpecId {
pub const BACKEND_DUMMY: Self = Self { id: 0 };
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct UpdateModeId {
id: u32,
}
@ -1878,7 +1878,7 @@ impl UpdateModeId {
pub const BACKEND_DUMMY: Self = Self { id: 0 };
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct UpdateModeIds {
next: u32,
}
@ -1895,7 +1895,7 @@ impl UpdateModeIds {
}
}
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum CallType<'a> {
ByName {
name: LambdaName<'a>,
@ -1914,7 +1914,7 @@ pub enum CallType<'a> {
HigherOrder(&'a HigherOrderLowLevel<'a>),
}
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct PassedFunction<'a> {
/// name of the top-level function that is passed as an argument
/// e.g. in `List.map xs Num.abs` this would be `Num.abs`
@ -1931,7 +1931,7 @@ pub struct PassedFunction<'a> {
pub owns_captured_environment: bool,
}
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct HigherOrderLowLevel<'a> {
pub op: crate::low_level::HigherOrder,
@ -7009,7 +7009,7 @@ fn substitute_in_call<'a>(
} => substitute(subs, name.name()).map(|new| CallType::ByName {
name: name.replace_name(new),
arg_layouts,
ret_layout: *ret_layout,
ret_layout,
specialization_id: *specialization_id,
}),
CallType::Foreign { .. } => None,
@ -7158,7 +7158,7 @@ fn substitute_in_expr<'a>(
} => match substitute(subs, *structure) {
Some(structure) => Some(StructAtIndex {
index: *index,
field_layouts: *field_layouts,
field_layouts,
structure,
}),
None => None,

View file

@ -1,6 +1,6 @@
use roc_module::symbol::Symbol;
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HigherOrder {
ListMap {
xs: Symbol,

View file

@ -128,7 +128,7 @@ fn function_s<'a, 'i>(
remainder,
} => {
let id = *id;
let body: &Stmt = *body;
let body: &Stmt = body;
let new_body = function_s(env, w, c, body);
let new_join = if std::ptr::eq(body, new_body) || body == new_body {
@ -179,7 +179,7 @@ fn function_s<'a, 'i>(
arena.alloc(new_switch)
}
Refcounting(op, continuation) => {
let continuation: &Stmt = *continuation;
let continuation: &Stmt = continuation;
let new_continuation = function_s(env, w, c, continuation);
if std::ptr::eq(continuation, new_continuation) || continuation == new_continuation {
@ -198,7 +198,7 @@ fn function_s<'a, 'i>(
layouts,
remainder,
} => {
let continuation: &Stmt = *remainder;
let continuation: &Stmt = remainder;
let new_continuation = function_s(env, w, c, continuation);
if std::ptr::eq(continuation, new_continuation) || continuation == new_continuation {
@ -223,7 +223,7 @@ fn function_s<'a, 'i>(
layouts,
remainder,
} => {
let continuation: &Stmt = *remainder;
let continuation: &Stmt = remainder;
let new_continuation = function_s(env, w, c, continuation);
if std::ptr::eq(continuation, new_continuation) || continuation == new_continuation {