Struct rustc_interface::util::ReplaceBodyWithLoop[−][src]

pub struct ReplaceBodyWithLoop<'a, 'b> {
    within_static_or_const: bool,
    nested_blocks: Option<Vec<Block>>,
    resolver: &'a mut Resolver<'b>,
}

Replaces function bodies with loop {} (an infinite loop). This gets rid of all semantic errors in the body while still satisfying the return type, except in certain cases, see below for more.

This pass is known as everybody_loops. Very punny.

As of March 2021, everybody_loops is only used for the -Z unpretty=everybody_loops debugging option.

FIXME: Currently the everybody_loops transformation is not applied to:

Fields

within_static_or_const: boolnested_blocks: Option<Vec<Block>>resolver: &'a mut Resolver<'b>

Implementations

impl<'a, 'b> ReplaceBodyWithLoop<'a, 'b>[src]

pub fn new(resolver: &'a mut Resolver<'b>) -> ReplaceBodyWithLoop<'a, 'b>[src]

fn run<R, F: FnOnce(&mut Self) -> R>(&mut self, is_const: bool, action: F) -> R[src]

fn should_ignore_fn(ret_ty: &FnRetTy) -> bool[src]

fn is_sig_const(sig: &FnSig) -> bool[src]

Trait Implementations

impl<'a> MutVisitor for ReplaceBodyWithLoop<'a, '_>[src]

Auto Trait Implementations

impl<'a, 'b> !RefUnwindSafe for ReplaceBodyWithLoop<'a, 'b>

impl<'a, 'b> !Send for ReplaceBodyWithLoop<'a, 'b>

impl<'a, 'b> !Sync for ReplaceBodyWithLoop<'a, 'b>

impl<'a, 'b> Unpin for ReplaceBodyWithLoop<'a, 'b> where
    'b: 'a, 

impl<'a, 'b> !UnwindSafe for ReplaceBodyWithLoop<'a, 'b>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.