fn with_trait_items<T>(
        &mut self,
        trait_items: &Vec<P<AssocItem>>,
        f: impl FnOnce(&mut Self) -> T,
    ) -> T {
        let trait_assoc_types = replace(
            &mut self.diagnostic_metadata.current_trait_assoc_types,
            trait_items
                .iter()
                .filter_map(|item| match &item.kind {
                    AssocItemKind::TyAlias(_, _, bounds, _) if bounds.is_empty() => {
                        Some(item.ident)
                    }
                    _ => None,
                })
                .collect(),
        );
        let result = f(self);
        self.diagnostic_metadata.current_trait_assoc_types = trait_assoc_types;
        result
    }
/// When evaluating a `trait` use its associated types' idents for suggestionsa in E0412.
When evaluating a `trait` use its associated types' idents for suggestionsa in E0412.
When evaluating a ` trait ` use its associated types ' idents for suggestionsa in E0412 .
fn with_trait_items<T>(
        &mut self,
        trait_items: &Vec<P<AssocItem>>,
        f: impl FnOnce(&mut Self) -> T,
    ) -> T {
        let trait_assoc_types = replace(
            &mut self.diagnostic_metadata.current_trait_assoc_types,
            trait_items
                .iter()
                .filter_map(|item| match &item.kind {
                    AssocItemKind::TyAlias(_, _, bounds, _) if bounds.is_empty() => {
                        Some(item.ident)
                    }
                    _ => None,
                })
                .collect(),
        );
        let result = f(self);
        self.diagnostic_metadata.current_trait_assoc_types = trait_assoc_types;
        result
    }
fn with_trait_items < T > ( & mut self , trait_items : & Vec < P < AssocItem > > , f : impl FnOnce ( & mut Self ) -> T , ) -> T { let trait_assoc_types = replace ( & mut self . diagnostic_metadata . current_trait_assoc_types , trait_items . iter ( ) . filter_map ( | item | match & item . kind { AssocItemKind :: TyAlias ( _ , _ , bounds , _ ) if bounds . is_empty ( ) => { Some ( item . ident ) } _ => None , } ) . collect ( ) , ) ; let result = f ( self ) ; self . diagnostic_metadata . current_trait_assoc_types = trait_assoc_types ; result }
When evaluating a `trait` use its associated types' idents for suggestionsa in E0412.
When evaluating a ` trait ` use its associated types ' idents for suggestionsa in E0412 .
&mut self
trait_items
&Vec<P<AssocItem>>
f
impl FnOnce(&mut Self) -> T
&mut self
trait_items
&Vec<P<AssocItem>>
f
impl FnOnce(&mut Self) -> T