Core

Struct Core 

Source
pub struct Core {
    pub kind: CoreKind,
    pub ty: Ty,
    pub tier: Tier,
    pub span: Span,
    pub last_use: bool,
    pub order: u32,
    pub locals: u32,
}

Fields§

§kind: CoreKind§ty: Ty§tier: Tier

Which tier this node runs on. §4.2: “explicit tier annotation per node”.

§span: Span§last_use: bool

Set on a CoreKind::Var whose value this expression is the last reader of, so a backend may move the binding rather than copy it. crate::liveness is what sets it and what the guarantee means; false is always safe.

§order: u32

Set on a CoreKind::Make: which written field belongs at each position of the record it builds, packed four bits per field. crate::fields is what sets it and what the packing means; crate::fields::UNORDERED is always safe and means “sort at run time”.

It costs nothing: a u32 here fits in the padding last_use already leaves, so Core is 160 bytes either way.

§locals: u32

Set on a CoreKind::Lam: how many bindings its body makes, so a call can reserve room for them in one frame instead of allocating a scope per let. crate::frames is what sets it and what the count means; 0 is always safe and means “chain a scope, as before”.

Implementations§

Source§

impl Core

Source

pub fn new(kind: CoreKind, ty: Ty, span: Span) -> Core

Source

pub fn effects( &self, globals: &dyn Fn(&str) -> Vec<Effect>, out: &mut Vec<Effect>, )

Every effect this expression can perform, by walking what it calls.

Phase 1 used this as the effect analysis. Phase 2 does not: rows are inferred during checking, where a call’s latent row is known and a mere reference to a function performs nothing. What survives is this syntactic over-approximation, used in one place where that is the right answer — asking what a fold’s function body could reach, including through a function value it was handed.

Source

pub fn place(&mut self, tier: Tier)

Set the tier on this node and everything under it.

Trait Implementations§

Source§

impl Clone for Core

Source§

fn clone(&self) -> Core

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Core

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Core

§

impl RefUnwindSafe for Core

§

impl Send for Core

§

impl Sync for Core

§

impl Unpin for Core

§

impl UnwindSafe for Core

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.