11use crate :: def:: { CtorKind , DefKind , Res } ;
22use crate :: def_id:: { DefId , CRATE_DEF_ID } ;
33crate use crate :: hir_id:: { HirId , ItemLocalId } ;
4- use crate :: { itemlikevisit , LangItem } ;
4+ use crate :: LangItem ;
55
66use rustc_ast:: util:: parser:: ExprPrecedence ;
77use rustc_ast:: { self as ast, CrateSugar , LlvmAsmDialect } ;
@@ -10,7 +10,6 @@ pub use rustc_ast::{BorrowKind, ImplPolarity, IsAuto};
1010pub use rustc_ast:: { CaptureBy , Movability , Mutability } ;
1111use rustc_ast:: { InlineAsmOptions , InlineAsmTemplatePiece } ;
1212use rustc_data_structures:: fx:: FxHashMap ;
13- use rustc_data_structures:: sync:: { par_for_each_in, Send , Sync } ;
1413use rustc_index:: vec:: IndexVec ;
1514use rustc_macros:: HashStable_Generic ;
1615use rustc_span:: source_map:: Spanned ;
@@ -708,52 +707,6 @@ impl Crate<'hir> {
708707 }
709708}
710709
711- impl Crate < ' _ > {
712- /// Visits all items in the crate in some deterministic (but
713- /// unspecified) order. If you just need to process every item,
714- /// but don't care about nesting, this method is the best choice.
715- ///
716- /// If you do care about nesting -- usually because your algorithm
717- /// follows lexical scoping rules -- then you want a different
718- /// approach. You should override `visit_nested_item` in your
719- /// visitor and then call `intravisit::walk_crate` instead.
720- pub fn visit_all_item_likes < ' hir , V > ( & ' hir self , visitor : & mut V )
721- where
722- V : itemlikevisit:: ItemLikeVisitor < ' hir > ,
723- {
724- for owner in self . owners . iter ( ) . filter_map ( Option :: as_ref) {
725- match owner {
726- OwnerNode :: Item ( item) => visitor. visit_item ( item) ,
727- OwnerNode :: ForeignItem ( item) => visitor. visit_foreign_item ( item) ,
728- OwnerNode :: ImplItem ( item) => visitor. visit_impl_item ( item) ,
729- OwnerNode :: TraitItem ( item) => visitor. visit_trait_item ( item) ,
730- OwnerNode :: Crate ( _) => { }
731- }
732- }
733- }
734-
735- /// A parallel version of `visit_all_item_likes`.
736- pub fn par_visit_all_item_likes < ' hir , V > ( & ' hir self , visitor : & V )
737- where
738- V : itemlikevisit:: ParItemLikeVisitor < ' hir > + Sync + Send ,
739- {
740- par_for_each_in ( & self . owners . raw , |owner| match owner {
741- Some ( OwnerNode :: Item ( item) ) => visitor. visit_item ( item) ,
742- Some ( OwnerNode :: ForeignItem ( item) ) => visitor. visit_foreign_item ( item) ,
743- Some ( OwnerNode :: ImplItem ( item) ) => visitor. visit_impl_item ( item) ,
744- Some ( OwnerNode :: TraitItem ( item) ) => visitor. visit_trait_item ( item) ,
745- Some ( OwnerNode :: Crate ( _) ) | None => { }
746- } )
747- }
748-
749- pub fn items < ' hir > ( & ' hir self ) -> impl Iterator < Item = & ' hir Item < ' hir > > + ' hir {
750- self . owners . iter ( ) . filter_map ( |owner| match owner {
751- Some ( OwnerNode :: Item ( item) ) => Some ( * item) ,
752- _ => None ,
753- } )
754- }
755- }
756-
757710/// A block of statements `{ .. }`, which may have a label (in this case the
758711/// `targeted_by_break` field will be `true`) and may be `unsafe` by means of
759712/// the `rules` being anything but `DefaultBlock`.
0 commit comments