Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix rustc_hir reexports in rustc::hir #67886

Merged
merged 4 commits into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3368,6 +3368,7 @@ dependencies = [
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_session",
"rustc_span",
Expand Down Expand Up @@ -3411,6 +3412,7 @@ dependencies = [
"rustc_expand",
"rustc_feature",
"rustc_fs_util",
"rustc_hir",
"rustc_incremental",
"rustc_index",
"rustc_llvm",
Expand Down Expand Up @@ -3439,6 +3441,7 @@ dependencies = [
"rustc_error_codes",
"rustc_errors",
"rustc_fs_util",
"rustc_hir",
"rustc_incremental",
"rustc_index",
"rustc_session",
Expand All @@ -3458,6 +3461,7 @@ dependencies = [
"rustc",
"rustc-demangle",
"rustc_data_structures",
"rustc_hir",
"rustc_metadata",
"rustc_span",
"rustc_target",
Expand Down Expand Up @@ -3502,6 +3506,7 @@ dependencies = [
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_interface",
"rustc_lint",
"rustc_metadata",
Expand Down Expand Up @@ -3590,6 +3595,7 @@ dependencies = [
"rustc",
"rustc_data_structures",
"rustc_fs_util",
"rustc_hir",
"rustc_session",
"rustc_span",
"serialize",
Expand Down Expand Up @@ -3656,6 +3662,7 @@ dependencies = [
"rustc_data_structures",
"rustc_error_codes",
"rustc_feature",
"rustc_hir",
"rustc_index",
"rustc_session",
"rustc_span",
Expand Down Expand Up @@ -3707,6 +3714,7 @@ dependencies = [
"rustc_error_codes",
"rustc_errors",
"rustc_expand",
"rustc_hir",
"rustc_index",
"rustc_parse",
"rustc_span",
Expand All @@ -3733,6 +3741,7 @@ dependencies = [
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_lexer",
"rustc_macros",
Expand Down Expand Up @@ -3781,6 +3790,7 @@ dependencies = [
"rustc_error_codes",
"rustc_errors",
"rustc_feature",
"rustc_hir",
"rustc_index",
"rustc_parse",
"rustc_span",
Expand All @@ -3794,6 +3804,7 @@ version = "0.0.0"
dependencies = [
"rustc",
"rustc_error_codes",
"rustc_hir",
"rustc_metadata",
"rustc_span",
"syntax",
Expand All @@ -3807,6 +3818,7 @@ dependencies = [
"rustc",
"rustc_data_structures",
"rustc_error_codes",
"rustc_hir",
"rustc_span",
"rustc_typeck",
"syntax",
Expand All @@ -3826,6 +3838,7 @@ dependencies = [
"rustc_errors",
"rustc_expand",
"rustc_feature",
"rustc_hir",
"rustc_metadata",
"rustc_session",
"rustc_span",
Expand All @@ -3843,6 +3856,7 @@ dependencies = [
"rustc",
"rustc_codegen_utils",
"rustc_data_structures",
"rustc_hir",
"rustc_parse",
"rustc_span",
"serde_json",
Expand Down Expand Up @@ -3911,6 +3925,7 @@ dependencies = [
"log",
"rustc",
"rustc_data_structures",
"rustc_hir",
"rustc_macros",
"rustc_span",
"rustc_target",
Expand Down Expand Up @@ -3939,6 +3954,7 @@ dependencies = [
"rustc_data_structures",
"rustc_error_codes",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_span",
"rustc_target",
Expand Down
82 changes: 41 additions & 41 deletions src/librustc/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ macro_rules! arena_types {
[] tables: rustc::ty::TypeckTables<$tcx>,
[] const_allocs: rustc::mir::interpret::Allocation,
[] vtable_method: Option<(
rustc::hir::def_id::DefId,
rustc_hir::def_id::DefId,
rustc::ty::subst::SubstsRef<$tcx>
)>,
[few, decode] mir_keys: rustc::hir::def_id::DefIdSet,
[few, decode] mir_keys: rustc_hir::def_id::DefIdSet,
[decode] specialization_graph: rustc::traits::specialization_graph::Graph,
[] region_scope_tree: rustc::middle::region::ScopeTree,
[] item_local_set: rustc::hir::ItemLocalSet,
[] item_local_set: rustc_hir::ItemLocalSet,
[decode] mir_const_qualif: rustc_index::bit_set::BitSet<rustc::mir::Local>,
[] trait_impls_of: rustc::ty::trait_def::TraitImpls,
[] dropck_outlives:
Expand Down Expand Up @@ -87,75 +87,75 @@ macro_rules! arena_types {
>,
[few] crate_inherent_impls: rustc::ty::CrateInherentImpls,
[few] upstream_monomorphizations:
rustc::hir::def_id::DefIdMap<
rustc_hir::def_id::DefIdMap<
rustc_data_structures::fx::FxHashMap<
rustc::ty::subst::SubstsRef<'tcx>,
rustc::hir::def_id::CrateNum
rustc_hir::def_id::CrateNum
>
>,
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
rustc_span::symbol::Symbol,
rustc::hir::def_id::DefId,
rustc_hir::def_id::DefId,
>,
[few] resolve_lifetimes: rustc::middle::resolve_lifetime::ResolveLifetimes,
[few] lint_levels: rustc::lint::LintLevelMap,
[few] stability_index: rustc::middle::stability::Index<'tcx>,
[few] features: rustc_feature::Features,
[few] all_traits: Vec<rustc::hir::def_id::DefId>,
[few] all_traits: Vec<rustc_hir::def_id::DefId>,
[few] privacy_access_levels: rustc::middle::privacy::AccessLevels,
[few] target_features_whitelist: rustc_data_structures::fx::FxHashMap<
String,
Option<rustc_span::symbol::Symbol>
>,
[few] wasm_import_module_map: rustc_data_structures::fx::FxHashMap<
rustc::hir::def_id::DefId,
rustc_hir::def_id::DefId,
String
>,
[few] get_lib_features: rustc::middle::lib_features::LibFeatures,
[few] defined_lib_features: rustc::middle::lang_items::LanguageItems,
[few] visible_parent_map: rustc::hir::def_id::DefIdMap<rustc::hir::def_id::DefId>,
[few] visible_parent_map: rustc_hir::def_id::DefIdMap<rustc_hir::def_id::DefId>,
[few] foreign_module: rustc::middle::cstore::ForeignModule,
[few] foreign_modules: Vec<rustc::middle::cstore::ForeignModule>,
[few] reachable_non_generics: rustc::hir::def_id::DefIdMap<
[few] reachable_non_generics: rustc_hir::def_id::DefIdMap<
rustc::middle::exported_symbols::SymbolExportLevel
>,
[few] crate_variances: rustc::ty::CrateVariancesMap<'tcx>,
[few] inferred_outlives_crate: rustc::ty::CratePredicatesMap<'tcx>,
[] upvars: rustc_data_structures::fx::FxIndexMap<rustc::hir::HirId, rustc::hir::Upvar>,
[] upvars: rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId, rustc_hir::Upvar>,

// HIR types
[few] hir_forest: rustc::hir::map::Forest<$tcx>,
[] arm: rustc::hir::Arm<$tcx>,
[] arm: rustc_hir::Arm<$tcx>,
[] attribute: syntax::ast::Attribute,
[] block: rustc::hir::Block<$tcx>,
[] bare_fn_ty: rustc::hir::BareFnTy<$tcx>,
[few] global_asm: rustc::hir::GlobalAsm,
[] generic_arg: rustc::hir::GenericArg<$tcx>,
[] generic_args: rustc::hir::GenericArgs<$tcx>,
[] generic_bound: rustc::hir::GenericBound<$tcx>,
[] generic_param: rustc::hir::GenericParam<$tcx>,
[] expr: rustc::hir::Expr<$tcx>,
[] field: rustc::hir::Field<$tcx>,
[] field_pat: rustc::hir::FieldPat<$tcx>,
[] fn_decl: rustc::hir::FnDecl<$tcx>,
[] foreign_item: rustc::hir::ForeignItem<$tcx>,
[] impl_item_ref: rustc::hir::ImplItemRef<$tcx>,
[] inline_asm: rustc::hir::InlineAsm<$tcx>,
[] local: rustc::hir::Local<$tcx>,
[few] macro_def: rustc::hir::MacroDef<$tcx>,
[] param: rustc::hir::Param<$tcx>,
[] pat: rustc::hir::Pat<$tcx>,
[] path: rustc::hir::Path<$tcx>,
[] path_segment: rustc::hir::PathSegment<$tcx>,
[] poly_trait_ref: rustc::hir::PolyTraitRef<$tcx>,
[] qpath: rustc::hir::QPath<$tcx>,
[] stmt: rustc::hir::Stmt<$tcx>,
[] struct_field: rustc::hir::StructField<$tcx>,
[] trait_item_ref: rustc::hir::TraitItemRef,
[] ty: rustc::hir::Ty<$tcx>,
[] type_binding: rustc::hir::TypeBinding<$tcx>,
[] variant: rustc::hir::Variant<$tcx>,
[] where_predicate: rustc::hir::WherePredicate<$tcx>,
[] block: rustc_hir::Block<$tcx>,
[] bare_fn_ty: rustc_hir::BareFnTy<$tcx>,
[few] global_asm: rustc_hir::GlobalAsm,
[] generic_arg: rustc_hir::GenericArg<$tcx>,
[] generic_args: rustc_hir::GenericArgs<$tcx>,
[] generic_bound: rustc_hir::GenericBound<$tcx>,
[] generic_param: rustc_hir::GenericParam<$tcx>,
[] expr: rustc_hir::Expr<$tcx>,
[] field: rustc_hir::Field<$tcx>,
[] field_pat: rustc_hir::FieldPat<$tcx>,
[] fn_decl: rustc_hir::FnDecl<$tcx>,
[] foreign_item: rustc_hir::ForeignItem<$tcx>,
[] impl_item_ref: rustc_hir::ImplItemRef<$tcx>,
[] inline_asm: rustc_hir::InlineAsm<$tcx>,
[] local: rustc_hir::Local<$tcx>,
[few] macro_def: rustc_hir::MacroDef<$tcx>,
[] param: rustc_hir::Param<$tcx>,
[] pat: rustc_hir::Pat<$tcx>,
[] path: rustc_hir::Path<$tcx>,
[] path_segment: rustc_hir::PathSegment<$tcx>,
[] poly_trait_ref: rustc_hir::PolyTraitRef<$tcx>,
[] qpath: rustc_hir::QPath<$tcx>,
[] stmt: rustc_hir::Stmt<$tcx>,
[] struct_field: rustc_hir::StructField<$tcx>,
[] trait_item_ref: rustc_hir::TraitItemRef,
[] ty: rustc_hir::Ty<$tcx>,
[] type_binding: rustc_hir::TypeBinding<$tcx>,
[] variant: rustc_hir::Variant<$tcx>,
[] where_predicate: rustc_hir::WherePredicate<$tcx>,
], $tcx);
)
}
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@
//! user of the `DepNode` API of having to know how to compute the expected
//! fingerprint for a given set of node parameters.

use crate::hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX};
use crate::hir::map::DefPathHash;
use crate::hir::HirId;
use crate::ich::{Fingerprint, StableHashingContext};
use crate::mir;
use crate::mir::interpret::GlobalId;

use crate::ich::{Fingerprint, StableHashingContext};
use crate::traits;
use crate::traits::query::{
CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal,
Expand All @@ -64,7 +61,10 @@ use crate::traits::query::{
};
use crate::ty::subst::SubstsRef;
use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt};

use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX};
use rustc_hir::HirId;
use rustc_span::symbol::Symbol;
use std::fmt;
use std::hash::Hash;
Expand Down
5 changes: 3 additions & 2 deletions src/librustc/dep_graph/safe.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! The `DepGraphSafe` trait

use crate::hir::def_id::DefId;
use crate::hir::BodyId;
use crate::ty::TyCtxt;

use rustc_hir::def_id::DefId;
use rustc_hir::BodyId;
use syntax::ast::NodeId;

/// The `DepGraphSafe` trait is used to specify what kinds of values
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
//! conflicts between multiple such attributes attached to the same
//! item.

use crate::hir::def_id::DefId;
use crate::hir::intravisit::{self, NestedVisitorMap, Visitor};
use crate::hir::DUMMY_HIR_ID;
use crate::hir::{self, HirId, Item, ItemKind, TraitItem, TraitItemKind};
use crate::lint::builtin::UNUSED_ATTRIBUTES;
use crate::ty::query::Providers;
use crate::ty::TyCtxt;

use rustc_error_codes::*;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::DUMMY_HIR_ID;
use rustc_hir::{self, HirId, Item, ItemKind, TraitItem, TraitItemKind};
use rustc_span::symbol::sym;
use rustc_span::Span;
use syntax::ast::Attribute;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/exports.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::hir::def::Res;
use crate::hir::def_id::DefIdMap;
use crate::ty;

use rustc_hir::def::Res;
use rustc_hir::def_id::DefIdMap;
use rustc_macros::HashStable;
use rustc_span::Span;
use syntax::ast;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
//! This order consistency is required in a few places in rustc, for
//! example generator inference, and possibly also HIR borrowck.

use crate::hir::itemlikevisit::{ItemLikeVisitor, ParItemLikeVisitor};
use crate::hir::map::Map;
use crate::hir::*;

use rustc_hir::itemlikevisit::{ItemLikeVisitor, ParItemLikeVisitor};
use rustc_hir::*;
use rustc_span::Span;
use syntax::ast::{Attribute, Ident, Label, Name};

Expand Down Expand Up @@ -867,7 +867,7 @@ pub fn walk_where_predicate<'v, V: Visitor<'v>>(
}

pub fn walk_fn_ret_ty<'v, V: Visitor<'v>>(visitor: &mut V, ret_ty: &'v FunctionRetTy<'v>) {
if let Return(ref output_ty) = *ret_ty {
if let FunctionRetTy::Return(ref output_ty) = *ret_ty {
visitor.visit_ty(output_ty)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/map/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
//! nested within a uniquely determined `FnLike`), and users can ask
//! for the `Code` associated with a particular NodeId.

use crate::hir as ast;
use crate::hir::intravisit::FnKind;
use crate::hir::map;
use crate::hir::{Expr, FnDecl, Node};
use rustc_hir as ast;
use rustc_hir::{Expr, FnDecl, Node};
use rustc_span::Span;
use syntax::ast::{Attribute, Ident};

Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/map/collector.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use super::*;
use crate::dep_graph::{DepGraph, DepKind, DepNodeIndex};
use crate::hir;
use crate::hir::def_id::{CrateNum, DefIndex, LOCAL_CRATE};
use crate::hir::intravisit::{NestedVisitorMap, Visitor};
use crate::hir::map::HirEntryMap;
use crate::ich::Fingerprint;
use crate::middle::cstore::CrateStore;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::svh::Svh;
use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, DefIndex, LOCAL_CRATE};
use rustc_index::vec::IndexVec;
use rustc_session::{CrateDisambiguator, Session};
use rustc_span::source_map::SourceMap;
Expand Down Expand Up @@ -268,7 +268,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
None => format!("{:?}", node),
};

let forgot_str = if hir_id == crate::hir::DUMMY_HIR_ID {
let forgot_str = if hir_id == hir::DUMMY_HIR_ID {
format!("\nMaybe you forgot to lower the node id {:?}?", node_id)
} else {
String::new()
Expand Down
Loading