pub struct TrailingIfContinue;Trait Implementations§
Source§impl Rule<JavaAst> for TrailingIfContinue
impl Rule<JavaAst> for TrailingIfContinue
fn name(&self) -> &'static str
Source§fn kinds(&self) -> &'static [NodeKind]
fn kinds(&self) -> &'static [NodeKind]
本规则关注的节点类别(空 = 全部类别)。pass 循环按类别建分派桶,
无关节点直接跳过检查——“全部规则 × 每节点一次虚调用“是扫描主开销。
声明必须覆盖 check() 入口的真实类别判定:多报只是浪费检查(正确),
漏报会让规则失效(漏改写,回归测试会暴露)。
Source§fn check(
&self,
ctx: RewriteCtx<'_, JavaAst>,
id: JavaId,
) -> Option<Edit<JavaAst>>
fn check( &self, ctx: RewriteCtx<'_, JavaAst>, id: JavaId, ) -> Option<Edit<JavaAst>>
在节点
id 处检查是否可改写。
契约:只读既有结构(可向 arena 追加新节点);结构变更只经 Edit 提案。Source§fn structural(&self) -> bool
fn structural(&self) -> bool
结构性规则:豁免成本严格下降约束。
适用于“内联后暂时变贵、由后续折叠回本“的变换(如方法内联)。
实现方必须自证终止(如:每次消费一类节点且不引入新的同类节点)。
Auto Trait Implementations§
impl Freeze for TrailingIfContinue
impl RefUnwindSafe for TrailingIfContinue
impl Send for TrailingIfContinue
impl Sync for TrailingIfContinue
impl Unpin for TrailingIfContinue
impl UnsafeUnpin for TrailingIfContinue
impl UnwindSafe for TrailingIfContinue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more