// Clears (and restores) the `in_scope_lifetimes` field. Used when
// visiting nested items, which never inherit in-scope lifetimes
// from their surrounding environment.
Clears (and restores) the `in_scope_lifetimes` field. Used when
visiting nested items, which never inherit in-scope lifetimes
from their surrounding environment.
Clears ( and restores ) the ` in_scope_lifetimes ` field . Used when visiting nested items which never inherit in - scope lifetimes from their surrounding environment .
fn without_in_scope_lifetime_defs<T>(
        &mut self,
        f: impl FnOnce(&mut LoweringContext<'_>) -> T,
    ) -> T {
        let old_in_scope_lifetimes = std::mem::replace(&mut self.in_scope_lifetimes, vec![]);
        // this vector is only used when walking over impl headers,
        // input types, and the like, and should not be non-empty in
        // between items
        assert!(self.lifetimes_to_define.is_empty());
        let res = f(self);
        assert!(self.in_scope_lifetimes.is_empty());
        self.in_scope_lifetimes = old_in_scope_lifetimes;
        res
    }
fn without_in_scope_lifetime_defs < T > ( & mut self , f : impl FnOnce ( & mut LoweringContext < ' _ > ) -> T , ) -> T { let old_in_scope_lifetimes = std :: mem :: replace ( & mut self . in_scope_lifetimes , vec ! [ ] ) ; // this vector is only used when walking over impl headers, // input types, and the like, and should not be non-empty in // between items assert ! ( self lifetimes_to_define is_empty ( ) ) ; let res = f ( self ) ; assert ! ( self in_scope_lifetimes is_empty ( ) ) ; self . in_scope_lifetimes = old_in_scope_lifetimes ; res }
Clears (and restores) the `in_scope_lifetimes` field.
Clears ( and restores ) the ` in_scope_lifetimes ` field .
&mut self
f
impl FnOnce(&mut LoweringContext<'_>) -> T