Merge branch 'glue-exposed' into glue-getters

This commit is contained in:
Richard Feldman 2022-11-11 17:01:49 -05:00
commit 99420f65ed
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
329 changed files with 8031 additions and 4927 deletions

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),
@ -1796,7 +1796,7 @@ impl<'a> ListLiteralElement<'a> {
}
}
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Call<'a> {
pub call_type: CallType<'a>,
pub arguments: &'a [Symbol],
@ -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,
@ -2358,15 +2358,10 @@ impl<'a> Stmt<'a> {
pub fn is_terminal(&self) -> bool {
use Stmt::*;
match self {
Switch { .. } => {
// TODO is this the reason Lean only looks at the outermost `when`?
true
}
Ret(_) => true,
Jump(_, _) => true,
_ => false,
}
matches!(
self,
Switch { .. } | Ret(_) | Jump(_, _) // TODO for Switch; is this the reason Lean only looks at the outermost `when`?
)
}
pub fn if_then_else(
@ -6485,7 +6480,7 @@ pub fn from_can<'a>(
stmt = with_hole(
env,
loc_condition.value,
variable,
Variable::BOOL,
procs,
layout_cache,
cond_symbol,
@ -6541,7 +6536,7 @@ pub fn from_can<'a>(
stmt = with_hole(
env,
loc_condition.value,
variable,
Variable::BOOL,
procs,
layout_cache,
cond_symbol,
@ -7009,7 +7004,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 +7153,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,