Skip to main content

TrailingReturn

Struct TrailingReturn 

Source
pub struct TrailingReturn;

Trait Implementations§

Source§

impl<L: Lang> Rule<L> for TrailingReturn

Source§

fn name(&self) -> &'static str

Source§

fn kinds(&self) -> &'static [NodeKind]

本规则关注的节点类别(空 = 全部类别)。pass 循环按类别建分派桶, 无关节点直接跳过检查——“全部规则 × 每节点一次虚调用“是扫描主开销。 声明必须覆盖 check() 入口的真实类别判定:多报只是浪费检查(正确), 漏报会让规则失效(漏改写,回归测试会暴露)。
Source§

fn check(&self, ctx: RewriteCtx<'_, L>, id: L::Id) -> Option<Edit<L>>

在节点 id 处检查是否可改写。 契约:只读既有结构(可向 arena 追加新节点);结构变更只经 Edit 提案。
Source§

fn structural(&self) -> bool

结构性规则:豁免成本严格下降约束。 适用于“内联后暂时变贵、由后续折叠回本“的变换(如方法内联)。 实现方必须自证终止(如:每次消费一类节点且不引入新的同类节点)。

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.