Remove `extern crate rustc_macros` from `rustc_middle`.

This commit is contained in:
Nicholas Nethercote 2024-04-29 11:14:55 +10:00
parent 4814fd0a4b
commit 6ce258f657
71 changed files with 80 additions and 28 deletions

View File

@ -1,7 +1,7 @@
use std::fmt;
use rustc_errors::{codes::*, DiagArgName, DiagArgValue, DiagMessage};
use rustc_macros::Diagnostic;
use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::{Span, Symbol};
use crate::ty::Ty;

View File

@ -15,6 +15,7 @@ use rustc_data_structures::sync::{try_par_for_each_in, DynSend, DynSync};
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId};
use rustc_hir::*;
use rustc_macros::{Decodable, Encodable, HashStable};
use rustc_span::{ErrorGuaranteed, ExpnId};
/// Gather the LocalDefId for each item-like within a module, including items contained within

View File

@ -2,6 +2,7 @@ use crate::ty;
use crate::ty::Ty;
use rustc_hir::HirId;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_target::abi::{FieldIdx, VariantIdx};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]

View File

@ -23,7 +23,7 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lock;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_type_ir::Canonical as IrCanonical;
use rustc_type_ir::CanonicalVarInfo as IrCanonicalVarInfo;
pub use rustc_type_ir::{CanonicalTyVarKind, CanonicalVarKind};

View File

@ -4,6 +4,7 @@ pub mod unify_key;
use crate::ty::Region;
use crate::ty::{OpaqueTypeKey, Ty};
use rustc_data_structures::sync::Lrc;
use rustc_macros::{HashStable, TypeFoldable, TypeVisitable};
use rustc_span::Span;
/// Requires that `region` must be equal to one of the regions in `choice_regions`.

View File

@ -68,8 +68,6 @@
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate rustc_macros;
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
extern crate tracing;

View File

@ -4,6 +4,7 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::sorted_map::SortedMap;
use rustc_errors::{Diag, DiagMessage, MultiSpan};
use rustc_hir::{HirId, ItemLocalId};
use rustc_macros::HashStable;
use rustc_session::lint::{
builtin::{self, FORBIDDEN_LINT_GROUPS},
FutureIncompatibilityReason, Level, Lint, LintId,

View File

@ -1,7 +1,7 @@
use crate::ty;
use rustc_hir::def::Res;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::def_id::DefId;
use rustc_span::symbol::Ident;
use smallvec::SmallVec;

View File

@ -1,5 +1,6 @@
use crate::mir::mono::Linkage;
use rustc_attr::{InlineAttr, InstructionSetAttr, OptimizeAttr};
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::symbol::Symbol;
use rustc_target::abi::Align;
use rustc_target::spec::SanitizerSet;

View File

@ -1,4 +1,5 @@
use rustc_data_structures::sync::Lrc;
use rustc_macros::{Decodable, Encodable, HashStable};
use std::path::PathBuf;
#[derive(HashStable)]

View File

@ -4,6 +4,7 @@
//! For all the gory details, see the provider of the `dependency_formats`
//! query.
use rustc_macros::{Decodable, Encodable, HashStable};
use rustc_session::config::CrateType;
/// A list of dependencies for a certain crate type.

View File

@ -1,7 +1,7 @@
use crate::ty::GenericArgsRef;
use crate::ty::{self, Ty, TyCtxt};
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
use rustc_macros::HashStable;
use rustc_macros::{Decodable, Encodable, HashStable, TyDecodable, TyEncodable};
/// The SymbolExportLevel of a symbols specifies from which kinds of crates
/// the symbol will be exported. `C` symbols will be exported from any

View File

@ -5,6 +5,7 @@ pub mod exported_symbols;
pub mod lang_items;
pub mod lib_features {
use rustc_data_structures::unord::UnordMap;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::{symbol::Symbol, Span};
#[derive(Copy, Clone, Debug, PartialEq, Eq)]

View File

@ -11,7 +11,7 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::unord::UnordMap;
use rustc_hir as hir;
use rustc_hir::{HirId, HirIdMap, Node};
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::{Span, DUMMY_SP};
use std::fmt;

View File

@ -6,7 +6,7 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::ErrorGuaranteed;
use rustc_hir::def_id::DefId;
use rustc_hir::{ItemLocalId, OwnerId};
use rustc_macros::HashStable;
use rustc_macros::{Decodable, Encodable, HashStable, TyDecodable, TyEncodable};
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable, Debug, HashStable)]
pub enum ResolvedArg {

View File

@ -14,6 +14,7 @@ use rustc_feature::GateIssue;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId, LocalDefIdMap};
use rustc_hir::{self as hir, HirId};
use rustc_macros::{Decodable, Encodable, HashStable};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE};
use rustc_session::lint::{BuiltinLintDiag, Level, Lint, LintBuffer};

View File

@ -7,6 +7,7 @@ use rustc_data_structures::graph::dominators::{dominators, Dominators};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::OnceLock;
use rustc_index::{IndexSlice, IndexVec};
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use smallvec::SmallVec;

View File

@ -1,6 +1,7 @@
use std::fmt::{self, Debug, Display, Formatter};
use rustc_hir::def_id::DefId;
use rustc_macros::{HashStable, Lift, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_session::{config::RemapPathScopeComponents, RemapFileNameExt};
use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::{HasDataLayout, Size};

View File

@ -1,7 +1,7 @@
//! Metadata from source code coverage analysis and instrumentation.
use rustc_index::IndexVec;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_span::{Span, Symbol};
use std::fmt::{self, Debug, Formatter};

View File

@ -14,6 +14,7 @@ use either::{Left, Right};
use rustc_ast::Mutability;
use rustc_data_structures::intern::Interned;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_target::abi::{Align, HasDataLayout, Size};
use super::{

View File

@ -5,6 +5,7 @@ use std::hash;
use std::iter;
use std::ops::Range;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_serialize::{Decodable, Encodable};
use rustc_target::abi::Size;
use rustc_type_ir::{TyDecoder, TyEncoder};

View File

@ -4,6 +4,7 @@
use std::cmp;
use rustc_data_structures::sorted_map::SortedMap;
use rustc_macros::HashStable;
use rustc_target::abi::{HasDataLayout, Size};
use super::{alloc_range, AllocError, AllocRange, AllocResult, CtfeProvenance, Provenance};

View File

@ -7,7 +7,7 @@ use crate::ty::{self, layout, tls, Ty, TyCtxt, ValTree};
use rustc_ast_ir::Mutability;
use rustc_data_structures::sync::Lock;
use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage, ErrorGuaranteed, IntoDiagArg};
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_session::CtfeBacktrace;
use rustc_span::{def_id::DefId, Span, DUMMY_SP};
use rustc_target::abi::{call, Align, Size, VariantIdx, WrappingRange};

View File

@ -131,7 +131,7 @@ use rustc_data_structures::sync::{HashMapExt, Lock};
use rustc_data_structures::tiny_list::TinyList;
use rustc_errors::ErrorGuaranteed;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_serialize::{Decodable, Encodable};
use rustc_target::abi::{AddressSpace, Endian, HasDataLayout};

View File

@ -1,6 +1,6 @@
use super::{AllocId, InterpResult};
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_target::abi::{HasDataLayout, Size};
use std::{fmt, num::NonZero};

View File

@ -6,7 +6,7 @@ use rustc_apfloat::{
ieee::{Double, Half, Quad, Single},
Float,
};
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_target::abi::{HasDataLayout, Size};
use crate::ty::ScalarInt;

View File

@ -20,6 +20,7 @@ use rustc_hir::def_id::{DefId, CRATE_DEF_ID};
use rustc_hir::{
self as hir, BindingMode, ByRef, CoroutineDesugaring, CoroutineKind, HirId, ImplicitSelfKind,
};
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_session::Session;
use rustc_span::source_map::Spanned;
use rustc_target::abi::{FieldIdx, VariantIdx};

View File

@ -9,6 +9,7 @@ use rustc_data_structures::stable_hasher::{Hash128, HashStable, StableHasher};
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc_hir::ItemId;
use rustc_index::Idx;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_query_system::ich::StableHashingContext;
use rustc_session::config::OptLevel;
use rustc_span::symbol::Symbol;

View File

@ -7,6 +7,7 @@ use rustc_errors::ErrorGuaranteed;
use rustc_hir::def_id::LocalDefId;
use rustc_index::bit_set::BitMatrix;
use rustc_index::{Idx, IndexVec};
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use rustc_target::abi::{FieldIdx, VariantIdx};

View File

@ -17,6 +17,7 @@ use rustc_data_structures::packed::Pu128;
use rustc_hir::def_id::DefId;
use rustc_hir::CoroutineKind;
use rustc_index::IndexVec;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_span::source_map::Spanned;
use rustc_target::abi::{FieldIdx, VariantIdx};

View File

@ -4,7 +4,7 @@ use smallvec::SmallVec;
use super::TerminatorKind;
use rustc_data_structures::packed::Pu128;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use std::slice;
use super::*;

View File

@ -72,6 +72,7 @@ use rustc_hir::def_id::{
use rustc_hir::lang_items::{LangItem, LanguageItems};
use rustc_hir::{Crate, ItemLocalId, ItemLocalMap, TraitCandidate};
use rustc_index::IndexVec;
use rustc_macros::rustc_queries;
use rustc_query_system::ich::StableHashingContext;
use rustc_query_system::query::{try_get_cached, QueryCache, QueryMode, QueryState};
use rustc_session::config::{EntryFnType, OptLevel, OutputFilenames, SymbolManglingVersion};

View File

@ -6,6 +6,7 @@ use rustc_data_structures::unord::{UnordMap, UnordSet};
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, StableCrateId, LOCAL_CRATE};
use rustc_hir::definitions::DefPathHash;
use rustc_index::{Idx, IndexVec};
use rustc_macros::{Decodable, Encodable};
use rustc_middle::dep_graph::{DepNodeIndex, SerializedDepNodeIndex};
use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState};
use rustc_middle::mir::{self, interpret};

View File

@ -12,6 +12,7 @@ use rustc_data_structures::sync::AtomicU64;
use rustc_data_structures::sync::WorkerLocal;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::hir_id::OwnerId;
use rustc_macros::HashStable;
use rustc_query_system::dep_graph::DepNodeIndex;
use rustc_query_system::dep_graph::SerializedDepNodeIndex;
pub(crate) use rustc_query_system::query::QueryJobId;

View File

@ -15,6 +15,7 @@ use rustc_hir::def_id::DefId;
use rustc_hir::{BindingMode, ByRef, HirId, MatchSource, RangeEnd};
use rustc_index::newtype_index;
use rustc_index::IndexVec;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeVisitable};
use rustc_middle::middle::region;
use rustc_middle::mir::interpret::AllocId;
use rustc_middle::mir::{self, BinOp, BorrowKind, FakeReadCause, UnOp};

View File

@ -20,6 +20,9 @@ use rustc_errors::{Applicability, Diag, EmissionGuarantee};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::HirId;
use rustc_macros::{
Decodable, Encodable, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable,
};
use rustc_span::def_id::{LocalDefId, CRATE_DEF_ID};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};

View File

@ -10,11 +10,13 @@ use crate::infer::canonical::{Canonical, QueryResponse};
use crate::ty::error::TypeError;
use crate::ty::GenericArg;
use crate::ty::{self, Ty, TyCtxt};
use rustc_macros::{HashStable, TypeFoldable, TypeVisitable};
use rustc_span::Span;
pub mod type_op {
use crate::ty::fold::TypeFoldable;
use crate::ty::{Predicate, Ty, TyCtxt, UserType};
use rustc_macros::{HashStable, TypeFoldable, TypeVisitable};
use std::fmt;
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, HashStable, TypeFoldable, TypeVisitable)]

View File

@ -10,6 +10,7 @@ use rustc_errors::ErrorGuaranteed;
use crate::ty;
use rustc_hir::def_id::DefId;
use rustc_macros::{HashStable, TypeVisitable};
use rustc_query_system::cache::Cache;
pub type SelectionCache<'tcx> = Cache<

View File

@ -1,5 +1,6 @@
use rustc_ast_ir::try_visit;
use rustc_data_structures::intern::Interned;
use rustc_macros::{HashStable, TypeFoldable, TypeVisitable};
use rustc_span::def_id::DefId;
use crate::infer::canonical::{CanonicalVarValues, QueryRegionConstraints};

View File

@ -24,6 +24,7 @@ use super::{
};
use crate::{infer::canonical::CanonicalVarValues, ty};
use format::ProofTreeFormatter;
use rustc_macros::{TypeFoldable, TypeVisitable};
use std::fmt::{Debug, Write};
mod format;

View File

@ -5,6 +5,7 @@ use crate::ty::{self, TyCtxt};
use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::ErrorGuaranteed;
use rustc_hir::def_id::{DefId, DefIdMap};
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::symbol::sym;
/// A per-trait graph of impls in specialization order. At the moment, this

View File

@ -4,6 +4,7 @@ use crate::ty::{
TypeVisitableExt,
};
use rustc_errors::ErrorGuaranteed;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeVisitable};
#[derive(Hash, Debug, Clone, Copy, Ord, PartialOrd, PartialEq, Eq)]
#[derive(TyDecodable, TyEncodable, HashStable, TypeVisitable, TypeFoldable)]

View File

@ -1,7 +1,7 @@
use crate::ty::{self, Ty, TyCtxt};
use rustc_hir as hir;
use rustc_hir::lang_items::LangItem;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_span::Span;
use rustc_target::abi::FieldIdx;

View File

@ -12,6 +12,7 @@ use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_index::{IndexSlice, IndexVec};
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_query_system::ich::StableHashingContext;
use rustc_session::DataTypeKind;
use rustc_span::symbol::sym;
@ -582,8 +583,7 @@ impl<'tcx> AdtDef<'tcx> {
}
}
#[derive(Clone, Copy, Debug)]
#[derive(HashStable)]
#[derive(Clone, Copy, Debug, HashStable)]
pub enum Representability {
Representable,
Infinite(ErrorGuaranteed),

View File

@ -3,6 +3,7 @@ use rustc_data_structures::sorted_map::SortedIndexMultiMap;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Namespace};
use rustc_hir::def_id::DefId;
use rustc_macros::{Decodable, Encodable, HashStable};
use rustc_span::symbol::{Ident, Symbol};
use super::{TyCtxt, Visibility};

View File

@ -4,7 +4,7 @@
use crate::ty::{self, Ty};
use rustc_middle::mir;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
/// Types that are represented as ints.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]

View File

@ -11,6 +11,7 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_hir as hir;
use rustc_hir::def_id::LocalDefId;
use rustc_hir::HirId;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_span::def_id::LocalDefIdMap;
use rustc_span::symbol::Ident;
use rustc_span::{Span, Symbol};

View File

@ -6,7 +6,7 @@ use rustc_error_messages::MultiSpan;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::LocalDefId;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_type_ir::ConstKind as IrConstKind;
use rustc_type_ir::{ConstTy, IntoKind, TypeFlags, WithCachedTypeInfo};

View File

@ -4,7 +4,7 @@ use crate::ty::abstract_const::CastKind;
use crate::ty::GenericArgsRef;
use crate::ty::{self, visit::TypeVisitableExt as _, List, Ty, TyCtxt};
use rustc_hir::def_id::DefId;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
/// An unevaluated (potentially generic) constant used in the type-system.
#[derive(Copy, Clone, Eq, PartialEq, TyEncodable, TyDecodable)]

View File

@ -56,7 +56,7 @@ use rustc_hir::intravisit::Visitor;
use rustc_hir::lang_items::LangItem;
use rustc_hir::{HirId, Node, TraitCandidate};
use rustc_index::IndexVec;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_query_system::dep_graph::DepNodeIndex;
use rustc_query_system::ich::StableHashingContext;
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};

View File

@ -4,6 +4,7 @@ use rustc_errors::pluralize;
use rustc_hir as hir;
use rustc_hir::def::{CtorOf, DefKind};
use rustc_hir::def_id::DefId;
use rustc_macros::{TypeFoldable, TypeVisitable};
use rustc_span::symbol::Symbol;
use rustc_target::spec::abi;
use std::borrow::Cow;

View File

@ -2,6 +2,7 @@ use crate::mir::Mutability;
use crate::ty::GenericArgKind;
use crate::ty::{self, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt};
use rustc_hir::def_id::DefId;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use std::fmt::Debug;
use std::hash::Hash;
use std::iter;

View File

@ -11,7 +11,9 @@ use rustc_ast_ir::walk_visitable_list;
use rustc_data_structures::intern::Interned;
use rustc_errors::{DiagArgValue, IntoDiagArg};
use rustc_hir::def_id::DefId;
use rustc_macros::HashStable;
use rustc_macros::{
Decodable, Encodable, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable,
};
use rustc_serialize::{Decodable, Encodable};
use rustc_type_ir::WithCachedTypeInfo;
use smallvec::SmallVec;

View File

@ -3,6 +3,7 @@ use crate::ty::{EarlyBinder, GenericArgsRef};
use rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def_id::DefId;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::symbol::{kw, Symbol};
use rustc_span::Span;

View File

@ -1,3 +1,4 @@
use rustc_macros::HashStable;
use smallvec::SmallVec;
use crate::ty::context::TyCtxt;

View File

@ -8,7 +8,9 @@ use rustc_hir::def::Namespace;
use rustc_hir::def_id::{CrateNum, DefId};
use rustc_hir::lang_items::LangItem;
use rustc_index::bit_set::FiniteBitSet;
use rustc_macros::HashStable;
use rustc_macros::{
Decodable, Encodable, HashStable, Lift, TyDecodable, TyEncodable, TypeVisitable,
};
use rustc_middle::ty::normalize_erasing_regions::NormalizationError;
use rustc_span::def_id::LOCAL_CRATE;
use rustc_span::Symbol;

View File

@ -1,3 +1,4 @@
use rustc_macros::{Decodable, Encodable, HashStable};
use rustc_span::{def_id::DefId, Symbol};
use super::TyCtxt;

View File

@ -10,6 +10,7 @@ use rustc_errors::{
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_index::IndexVec;
use rustc_macros::{extension, HashStable, TyDecodable, TyEncodable};
use rustc_session::config::OptLevel;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};

View File

@ -47,7 +47,9 @@ use rustc_hir as hir;
use rustc_hir::def::{CtorKind, CtorOf, DefKind, DocLinkResMap, LifetimeRes, Res};
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LocalDefIdMap};
use rustc_index::IndexVec;
use rustc_macros::HashStable;
use rustc_macros::{
Decodable, Encodable, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable,
};
use rustc_query_system::ich::StableHashingContext;
use rustc_serialize::{Decodable, Encodable};
use rustc_session::lint::LintBuffer;

View File

@ -10,6 +10,7 @@
use crate::traits::query::NoSolution;
use crate::ty::fold::{FallibleTypeFolder, TypeFoldable, TypeFolder};
use crate::ty::{self, EarlyBinder, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt};
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
#[derive(Debug, Copy, Clone, HashStable, TyEncodable, TyDecodable)]
pub enum NormalizationError<'tcx> {

View File

@ -2,6 +2,7 @@ use std::fmt;
use crate::ty;
use rustc_data_structures::intern::Interned;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)]
#[rustc_pass_by_value]

View File

@ -3,6 +3,7 @@ use rustc_data_structures::intern::Interned;
use rustc_errors::{DiagArgValue, IntoDiagArg};
use rustc_hir::def_id::DefId;
use rustc_hir::LangItem;
use rustc_macros::{HashStable, Lift, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_span::Span;
use rustc_type_ir::ClauseKind as IrClauseKind;
use rustc_type_ir::PredicateKind as IrPredicateKind;

View File

@ -16,6 +16,7 @@ use rustc_hir::def::{self, CtorKind, DefKind, Namespace};
use rustc_hir::def_id::{DefIdMap, DefIdSet, ModDefId, CRATE_DEF_ID, LOCAL_CRATE};
use rustc_hir::definitions::{DefKey, DefPathDataName};
use rustc_hir::LangItem;
use rustc_macros::Lift;
use rustc_session::cstore::{ExternCrate, ExternCrateSource};
use rustc_session::Limit;
use rustc_span::symbol::{kw, Ident, Symbol};

View File

@ -3,6 +3,7 @@ use rustc_data_structures::intern::Interned;
use rustc_errors::MultiSpan;
use rustc_hir::def_id::DefId;
use rustc_index::Idx;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::symbol::sym;
use rustc_span::symbol::{kw, Symbol};
use rustc_span::{ErrorGuaranteed, DUMMY_SP};

View File

@ -10,6 +10,7 @@ use crate::ty::{GenericArg, GenericArgKind, GenericArgsRef};
use rustc_hir as hir;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::DefId;
use rustc_macros::TypeVisitable;
use rustc_target::spec::abi;
use std::iter;

View File

@ -1,6 +1,7 @@
use crate::middle::region::{Scope, ScopeData, ScopeTree};
use rustc_hir as hir;
use rustc_hir::ItemLocalMap;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
/// `RvalueScopes` is a mapping from sub-expressions to _extended_ lifetime as determined by
/// rules laid out in `rustc_hir_analysis::check::rvalue_scopes`.

View File

@ -17,7 +17,7 @@ use rustc_errors::{DiagArgValue, ErrorGuaranteed, IntoDiagArg, MultiSpan};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::LangItem;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, Lift, TyDecodable, TyEncodable, TypeFoldable};
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT};

View File

@ -8,7 +8,7 @@ use std::iter;
use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::ErrorGuaranteed;
use rustc_macros::HashStable;
use rustc_macros::{Decodable, Encodable, HashStable};
/// A trait's definition with type information.
#[derive(HashStable, Encodable, Decodable)]

View File

@ -18,7 +18,7 @@ use rustc_hir::{
BindingMode, ByRef, HirId, ItemLocalId, ItemLocalMap, ItemLocalSet, Mutability,
};
use rustc_index::IndexVec;
use rustc_macros::HashStable;
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
use rustc_middle::mir::FakeReadCause;
use rustc_session::Session;
use rustc_span::Span;

View File

@ -17,7 +17,7 @@ use rustc_hir as hir;
use rustc_hir::def::{CtorOf, DefKind, Res};
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId};
use rustc_index::bit_set::GrowableBitSet;
use rustc_macros::HashStable;
use rustc_macros::{extension, HashStable, TyDecodable, TyEncodable};
use rustc_session::Limit;
use rustc_span::sym;
use rustc_target::abi::{Integer, IntegerType, Primitive, Size};

View File

@ -3,6 +3,7 @@ use std::fmt;
use crate::mir::interpret::{alloc_range, AllocId, Allocation, Pointer, Scalar};
use crate::ty::{self, Instance, PolyTraitRef, Ty, TyCtxt};
use rustc_ast::Mutability;
use rustc_macros::HashStable;
#[derive(Clone, Copy, PartialEq, HashStable)]
pub enum VtblEntry<'tcx> {