Remove extern crate rustc_macros from numerous crates.

This commit is contained in:
Nicholas Nethercote 2024-04-29 08:53:45 +10:00
parent 10505a1cc9
commit 4814fd0a4b
110 changed files with 99 additions and 94 deletions

View File

@ -32,7 +32,7 @@ use rustc_data_structures::packed::Pu128;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::source_map::{respan, Spanned}; use rustc_span::source_map::{respan, Spanned};
use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};

View File

@ -1,3 +1,4 @@
use rustc_macros::HashStable_Generic;
use rustc_span::symbol::{sym, Symbol}; use rustc_span::symbol::{sym, Symbol};
#[derive(Clone, Debug, Copy, Eq, PartialEq, HashStable_Generic)] #[derive(Clone, Debug, Copy, Eq, PartialEq, HashStable_Generic)]

View File

@ -1,5 +1,6 @@
//! Definitions shared by macros / syntax extensions and e.g. `rustc_middle`. //! Definitions shared by macros / syntax extensions and e.g. `rustc_middle`.
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::{def_id::DefId, symbol::Ident}; use rustc_span::{def_id::DefId, symbol::Ident};
use crate::MetaItem; use crate::MetaItem;

View File

@ -1,6 +1,7 @@
use crate::ptr::P; use crate::ptr::P;
use crate::Expr; use crate::Expr;
use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashMap;
use rustc_macros::{Decodable, Encodable};
use rustc_span::symbol::{Ident, Symbol}; use rustc_span::symbol::{Ident, Symbol};
use rustc_span::Span; use rustc_span::Span;

View File

@ -20,9 +20,6 @@
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(stmt_expr_attributes)] #![feature(stmt_expr_attributes)]
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;

View File

@ -9,7 +9,7 @@ use crate::util::case::Case;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::symbol::{kw, sym}; use rustc_span::symbol::{kw, sym};
#[allow(clippy::useless_attribute)] // FIXME: following use of `hidden_glob_reexports` incorrectly triggers `useless_attribute` lint. #[allow(clippy::useless_attribute)] // FIXME: following use of `hidden_glob_reexports` incorrectly triggers `useless_attribute` lint.
#[allow(hidden_glob_reexports)] #[allow(hidden_glob_reexports)]

View File

@ -20,7 +20,7 @@ use crate::AttrVec;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::{self, Lrc}; use rustc_data_structures::sync::{self, Lrc};
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_serialize::{Decodable, Encodable}; use rustc_serialize::{Decodable, Encodable};
use rustc_span::{sym, Span, SpanDecoder, SpanEncoder, Symbol, DUMMY_SP}; use rustc_span::{sym, Span, SpanDecoder, SpanEncoder, Symbol, DUMMY_SP};
use smallvec::{smallvec, SmallVec}; use smallvec::{smallvec, SmallVec};

View File

@ -3,8 +3,7 @@
#![cfg_attr(feature = "nightly", allow(internal_features))] #![cfg_attr(feature = "nightly", allow(internal_features))]
#[cfg(feature = "nightly")] #[cfg(feature = "nightly")]
#[macro_use] use rustc_macros::{Decodable, Encodable, HashStable_NoContext};
extern crate rustc_macros;
pub mod visit; pub mod visit;

View File

@ -6,7 +6,7 @@ use rustc_ast::{Attribute, LitKind, MetaItem, MetaItemKind, MetaItemLit, NestedM
use rustc_ast_pretty::pprust; use rustc_ast_pretty::pprust;
use rustc_errors::ErrorGuaranteed; use rustc_errors::ErrorGuaranteed;
use rustc_feature::{find_gated_cfg, is_builtin_attr_name, Features, GatedCfg}; use rustc_feature::{find_gated_cfg, is_builtin_attr_name, Features, GatedCfg};
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_session::config::ExpectedValues; use rustc_session::config::ExpectedValues;
use rustc_session::lint::builtin::UNEXPECTED_CFGS; use rustc_session::lint::builtin::UNEXPECTED_CFGS;
use rustc_session::lint::BuiltinLintDiag; use rustc_session::lint::BuiltinLintDiag;

View File

@ -9,9 +9,6 @@
#![doc(rust_logo)] #![doc(rust_logo)]
#![feature(let_chains)] #![feature(let_chains)]
#[macro_use]
extern crate rustc_macros;
mod builtin; mod builtin;
mod session_diagnostics; mod session_diagnostics;

View File

@ -2,7 +2,7 @@ use std::num::IntErrorKind;
use rustc_ast as ast; use rustc_ast as ast;
use rustc_errors::{codes::*, Applicability, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level}; use rustc_errors::{codes::*, Applicability, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level};
use rustc_macros::Diagnostic; use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::{Span, Symbol}; use rustc_span::{Span, Symbol};
use crate::fluent_generated as fluent; use crate::fluent_generated as fluent;

View File

@ -5,6 +5,7 @@ use rustc_data_structures::{
fx::FxHashMap, fx::FxHashMap,
stable_hasher::{HashStable, StableHasher}, stable_hasher::{HashStable, StableHasher},
}; };
use rustc_macros::HashStable;
use rustc_middle::{ use rustc_middle::{
bug, bug,
ty::{ParamEnv, PolyExistentialTraitRef, Ty, TyCtxt}, ty::{ParamEnv, PolyExistentialTraitRef, Ty, TyCtxt},
@ -23,6 +24,8 @@ use crate::{
use super::{unknown_file_metadata, SmallVec, UNKNOWN_LINE_NUMBER}; use super::{unknown_file_metadata, SmallVec, UNKNOWN_LINE_NUMBER};
mod private { mod private {
use rustc_macros::HashStable;
// This type cannot be constructed outside of this module because // This type cannot be constructed outside of this module because
// it has a private field. We make use of this in order to prevent // it has a private field. We make use of this in order to prevent
// `UniqueTypeId` from being constructed directly, without asserting // `UniqueTypeId` from being constructed directly, without asserting

View File

@ -15,8 +15,6 @@
#![feature(let_chains)] #![feature(let_chains)]
#![feature(impl_trait_in_assoc_type)] #![feature(impl_trait_in_assoc_type)]
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;

View File

@ -16,8 +16,6 @@
//! The backend-agnostic functions of this crate use functions defined in various traits that //! The backend-agnostic functions of this crate use functions defined in various traits that
//! have to be implemented by each backend. //! have to be implemented by each backend.
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;
#[macro_use] #[macro_use]
@ -29,6 +27,7 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use rustc_data_structures::unord::UnordMap; use rustc_data_structures::unord::UnordMap;
use rustc_hir::def_id::CrateNum; use rustc_hir::def_id::CrateNum;
use rustc_macros::{Decodable, Encodable, HashStable};
use rustc_middle::dep_graph::WorkProduct; use rustc_middle::dep_graph::WorkProduct;
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile; use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
use rustc_middle::middle::dependency_format::Dependencies; use rustc_middle::middle::dependency_format::Dependencies;

View File

@ -41,8 +41,6 @@
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;
#[macro_use]
extern crate rustc_macros;
use std::fmt; use std::fmt;

View File

@ -1,4 +1,5 @@
use crate::stable_hasher::{HashStable, StableHasher, StableOrd}; use crate::stable_hasher::{HashStable, StableHasher, StableOrd};
use rustc_macros::{Decodable_Generic, Encodable_Generic};
use std::borrow::Borrow; use std::borrow::Borrow;
use std::fmt::Debug; use std::fmt::Debug;
use std::mem; use std::mem;

View File

@ -6,9 +6,9 @@
//! compiled from distinct sources. //! compiled from distinct sources.
use crate::fingerprint::Fingerprint; use crate::fingerprint::Fingerprint;
use std::fmt;
use crate::stable_hasher; use crate::stable_hasher;
use rustc_macros::{Decodable_Generic, Encodable_Generic};
use std::fmt;
#[derive(Copy, Clone, PartialEq, Eq, Debug, Encodable_Generic, Decodable_Generic, Hash)] #[derive(Copy, Clone, PartialEq, Eq, Debug, Encodable_Generic, Decodable_Generic, Hash)]
pub struct Svh { pub struct Svh {

View File

@ -3,6 +3,7 @@
//! as required by the query system. //! as required by the query system.
use rustc_hash::{FxHashMap, FxHashSet}; use rustc_hash::{FxHashMap, FxHashSet};
use rustc_macros::{Decodable_Generic, Encodable_Generic};
use std::{ use std::{
borrow::{Borrow, BorrowMut}, borrow::{Borrow, BorrowMut},
collections::hash_map::Entry, collections::hash_map::Entry,

View File

@ -7,6 +7,7 @@ use rustc_data_structures::fx::FxIndexMap;
use rustc_error_messages::fluent_value_from_str_list_sep_by_and; use rustc_error_messages::fluent_value_from_str_list_sep_by_and;
use rustc_error_messages::FluentValue; use rustc_error_messages::FluentValue;
use rustc_lint_defs::{Applicability, LintExpectationId}; use rustc_lint_defs::{Applicability, LintExpectationId};
use rustc_macros::{Decodable, Encodable};
use rustc_span::source_map::Spanned; use rustc_span::source_map::Spanned;
use rustc_span::symbol::Symbol; use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP}; use rustc_span::{Span, DUMMY_SP};

View File

@ -7,6 +7,7 @@ use crate::{
use rustc_ast as ast; use rustc_ast as ast;
use rustc_ast_pretty::pprust; use rustc_ast_pretty::pprust;
use rustc_hir as hir; use rustc_hir as hir;
use rustc_macros::Subdiagnostic;
use rustc_span::edition::Edition; use rustc_span::edition::Edition;
use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, Symbol}; use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, Symbol};
use rustc_span::Span; use rustc_span::Span;

View File

@ -25,9 +25,6 @@
#![feature(yeet_expr)] #![feature(yeet_expr)]
// tidy-alphabetical-end // tidy-alphabetical-end
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;
@ -64,6 +61,7 @@ use rustc_data_structures::stable_hasher::{Hash128, StableHasher};
use rustc_data_structures::sync::{Lock, Lrc}; use rustc_data_structures::sync::{Lock, Lrc};
use rustc_data_structures::AtomicRef; use rustc_data_structures::AtomicRef;
use rustc_lint_defs::LintExpectationId; use rustc_lint_defs::LintExpectationId;
use rustc_macros::{Decodable, Encodable};
use rustc_span::source_map::SourceMap; use rustc_span::source_map::SourceMap;
use rustc_span::{Loc, Span, DUMMY_SP}; use rustc_span::{Loc, Span, DUMMY_SP};
use std::backtrace::{Backtrace, BacktraceStatus}; use std::backtrace::{Backtrace, BacktraceStatus};

View File

@ -1,6 +1,7 @@
// Code for annotating snippets. // Code for annotating snippets.
use crate::{Level, Loc}; use crate::{Level, Loc};
use rustc_macros::{Decodable, Encodable};
#[derive(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)] #[derive(Clone, Debug, PartialOrd, Ord, PartialEq, Eq)]
pub struct Line { pub struct Line {

View File

@ -1,6 +1,6 @@
use rustc_ast::ast; use rustc_ast::ast;
use rustc_errors::codes::*; use rustc_errors::codes::*;
use rustc_macros::Diagnostic; use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_session::Limit; use rustc_session::Limit;
use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent}; use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent};
use rustc_span::{Span, Symbol}; use rustc_span::{Span, Symbol};

View File

@ -16,9 +16,6 @@
#![allow(rustc::diagnostic_outside_of_impl)] #![allow(rustc::diagnostic_outside_of_impl)]
#![allow(internal_features)] #![allow(internal_features)]
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;

View File

@ -14,6 +14,7 @@ pub(crate) mod transcribe;
use metavar_expr::MetaVarExpr; use metavar_expr::MetaVarExpr;
use rustc_ast::token::{Delimiter, NonterminalKind, Token, TokenKind}; use rustc_ast::token::{Delimiter, NonterminalKind, Token, TokenKind};
use rustc_ast::tokenstream::{DelimSpacing, DelimSpan}; use rustc_ast::tokenstream::{DelimSpacing, DelimSpan};
use rustc_macros::{Decodable, Encodable};
use rustc_span::symbol::Ident; use rustc_span::symbol::Ident;
use rustc_span::Span; use rustc_span::Span;

View File

@ -8,6 +8,7 @@ use rustc_ast::token::{self, Token, TokenKind};
use rustc_ast::tokenstream::TokenStream; use rustc_ast::tokenstream::TokenStream;
use rustc_ast_pretty::pprust; use rustc_ast_pretty::pprust;
use rustc_errors::{Applicability, Diag, DiagCtxt, DiagMessage}; use rustc_errors::{Applicability, Diag, DiagCtxt, DiagMessage};
use rustc_macros::Subdiagnostic;
use rustc_parse::parser::{Parser, Recovery}; use rustc_parse::parser::{Parser, Recovery};
use rustc_span::source_map::SourceMap; use rustc_span::source_map::SourceMap;
use rustc_span::symbol::Ident; use rustc_span::symbol::Ident;

View File

@ -3,6 +3,7 @@ use rustc_ast::tokenstream::{RefTokenTreeCursor, TokenStream, TokenTree};
use rustc_ast::{LitIntType, LitKind}; use rustc_ast::{LitIntType, LitKind};
use rustc_ast_pretty::pprust; use rustc_ast_pretty::pprust;
use rustc_errors::{Applicability, PResult}; use rustc_errors::{Applicability, PResult};
use rustc_macros::{Decodable, Encodable};
use rustc_session::parse::ParseSess; use rustc_session::parse::ParseSess;
use rustc_span::symbol::Ident; use rustc_span::symbol::Ident;
use rustc_span::Span; use rustc_span::Span;

View File

@ -5,7 +5,7 @@ use rustc_ast as ast;
use rustc_ast::NodeId; use rustc_ast::NodeId;
use rustc_data_structures::stable_hasher::ToStableHashKey; use rustc_data_structures::stable_hasher::ToStableHashKey;
use rustc_data_structures::unord::UnordMap; use rustc_data_structures::unord::UnordMap;
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::def_id::{DefId, LocalDefId}; use rustc_span::def_id::{DefId, LocalDefId};
use rustc_span::hygiene::MacroKind; use rustc_span::hygiene::MacroKind;
use rustc_span::symbol::kw; use rustc_span::symbol::kw;

View File

@ -11,6 +11,7 @@ use crate::def_path_hash_map::DefPathHashMap;
use rustc_data_structures::stable_hasher::{Hash64, StableHasher}; use rustc_data_structures::stable_hasher::{Hash64, StableHasher};
use rustc_data_structures::unord::UnordMap; use rustc_data_structures::unord::UnordMap;
use rustc_index::IndexVec; use rustc_index::IndexVec;
use rustc_macros::{Decodable, Encodable};
use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::symbol::{kw, sym, Symbol};
use std::fmt::{self, Write}; use std::fmt::{self, Write};

View File

@ -13,7 +13,7 @@ use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::sorted_map::SortedMap; use rustc_data_structures::sorted_map::SortedMap;
use rustc_index::IndexVec; use rustc_index::IndexVec;
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::hygiene::MacroKind; use rustc_span::hygiene::MacroKind;
use rustc_span::source_map::Spanned; use rustc_span::source_map::Spanned;
use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::symbol::{kw, sym, Ident, Symbol};

View File

@ -1,5 +1,6 @@
use crate::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_ID}; use crate::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_ID};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd, ToStableHashKey}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd, ToStableHashKey};
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::{def_id::DefPathHash, HashStableContext}; use rustc_span::{def_id::DefPathHash, HashStableContext};
use std::fmt::{self, Debug}; use std::fmt::{self, Debug};

View File

@ -12,7 +12,7 @@ use crate::{MethodKind, Target};
use rustc_ast as ast; use rustc_ast as ast;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span; use rustc_span::Span;

View File

@ -10,9 +10,6 @@
#![feature(variant_count)] #![feature(variant_count)]
#![allow(internal_features)] #![allow(internal_features)]
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;

View File

@ -7,6 +7,7 @@
//! [c]: https://rust-lang.github.io/chalk/book/canonical_queries/canonicalization.html //! [c]: https://rust-lang.github.io/chalk/book/canonical_queries/canonicalization.html
use crate::infer::canonical::{Canonical, CanonicalVarValues}; use crate::infer::canonical::{Canonical, CanonicalVarValues};
use rustc_macros::extension;
use rustc_middle::ty::fold::{FnMutDelegate, TypeFoldable}; use rustc_middle::ty::fold::{FnMutDelegate, TypeFoldable};
use rustc_middle::ty::GenericArgKind; use rustc_middle::ty::GenericArgKind;
use rustc_middle::ty::{self, TyCtxt}; use rustc_middle::ty::{self, TyCtxt};

View File

@ -68,6 +68,7 @@ use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::intravisit::Visitor; use rustc_hir::intravisit::Visitor;
use rustc_hir::lang_items::LangItem; use rustc_hir::lang_items::LangItem;
use rustc_macros::extension;
use rustc_middle::dep_graph::DepContext; use rustc_middle::dep_graph::DepContext;
use rustc_middle::ty::print::{with_forced_trimmed_paths, PrintError}; use rustc_middle::ty::print::{with_forced_trimmed_paths, PrintError};
use rustc_middle::ty::relate::{self, RelateResult, TypeRelation}; use rustc_middle::ty::relate::{self, RelateResult, TypeRelation};

View File

@ -4,6 +4,7 @@ pub use lexical_region_resolve::RegionResolutionError;
pub use relate::combine::CombineFields; pub use relate::combine::CombineFields;
pub use relate::combine::ObligationEmittingRelation; pub use relate::combine::ObligationEmittingRelation;
pub use relate::StructurallyRelateAliases; pub use relate::StructurallyRelateAliases;
pub use rustc_macros::{TypeFoldable, TypeVisitable};
pub use rustc_middle::ty::IntVarValue; pub use rustc_middle::ty::IntVarValue;
pub use BoundRegionConversionTime::*; pub use BoundRegionConversionTime::*;
pub use RegionVariableOrigin::*; pub use RegionVariableOrigin::*;
@ -20,13 +21,13 @@ use opaque_types::OpaqueTypeStorage;
use region_constraints::{GenericKind, VarInfos, VerifyBound}; use region_constraints::{GenericKind, VarInfos, VerifyBound};
use region_constraints::{RegionConstraintCollector, RegionConstraintStorage}; use region_constraints::{RegionConstraintCollector, RegionConstraintStorage};
use rustc_data_structures::captures::Captures; use rustc_data_structures::captures::Captures;
use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use rustc_data_structures::undo_log::Rollback; use rustc_data_structures::undo_log::Rollback;
use rustc_data_structures::unify as ut; use rustc_data_structures::unify as ut;
use rustc_errors::{Diag, DiagCtxt, ErrorGuaranteed}; use rustc_errors::{Diag, DiagCtxt, ErrorGuaranteed};
use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_macros::extension;
use rustc_middle::infer::canonical::{Canonical, CanonicalVarValues}; use rustc_middle::infer::canonical::{Canonical, CanonicalVarValues};
use rustc_middle::infer::unify_key::ConstVariableValue; use rustc_middle::infer::unify_key::ConstVariableValue;
use rustc_middle::infer::unify_key::EffectVarValue; use rustc_middle::infer::unify_key::EffectVarValue;

View File

@ -11,6 +11,7 @@ use rustc_data_structures::sync::Lrc;
use rustc_data_structures::undo_log::UndoLogs; use rustc_data_structures::undo_log::UndoLogs;
use rustc_data_structures::unify as ut; use rustc_data_structures::unify as ut;
use rustc_index::IndexVec; use rustc_index::IndexVec;
use rustc_macros::{TypeFoldable, TypeVisitable};
use rustc_middle::infer::unify_key::{RegionVariableValue, RegionVidKey}; use rustc_middle::infer::unify_key::{RegionVariableValue, RegionVidKey};
use rustc_middle::ty::ReStatic; use rustc_middle::ty::ReStatic;
use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::ty::{self, Ty, TyCtxt};

View File

@ -30,8 +30,6 @@
#![feature(yeet_expr)] #![feature(yeet_expr)]
#![recursion_limit = "512"] // For rustdoc #![recursion_limit = "512"] // For rustdoc
#[macro_use]
extern crate rustc_macros;
#[cfg(target_pointer_width = "64")] #[cfg(target_pointer_width = "64")]
#[macro_use] #[macro_use]
extern crate rustc_data_structures; extern crate rustc_data_structures;

View File

@ -1,6 +1,7 @@
use crate::infer::InferCtxt; use crate::infer::InferCtxt;
use crate::traits::Obligation; use crate::traits::Obligation;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_macros::extension;
use rustc_middle::ty::{self, ToPredicate, Ty}; use rustc_middle::ty::{self, ToPredicate, Ty};
use super::FulfillmentError; use super::FulfillmentError;

View File

@ -1,6 +1,3 @@
#[macro_use]
extern crate rustc_macros;
pub use self::Level::*; pub use self::Level::*;
use rustc_ast::node_id::NodeId; use rustc_ast::node_id::NodeId;
use rustc_ast::{AttrId, Attribute}; use rustc_ast::{AttrId, Attribute};
@ -11,6 +8,7 @@ use rustc_data_structures::stable_hasher::{
use rustc_error_messages::{DiagMessage, MultiSpan}; use rustc_error_messages::{DiagMessage, MultiSpan};
use rustc_hir::HashStableContext; use rustc_hir::HashStableContext;
use rustc_hir::HirId; use rustc_hir::HirId;
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::edition::Edition; use rustc_span::edition::Edition;
use rustc_span::{sym, symbol::Ident, Span, Symbol}; use rustc_span::{sym, symbol::Ident, Span, Symbol};
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;

View File

@ -4,7 +4,7 @@ use std::{
}; };
use rustc_errors::{codes::*, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level}; use rustc_errors::{codes::*, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level};
use rustc_macros::Diagnostic; use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_session::config; use rustc_session::config;
use rustc_span::{sym, Span, Symbol}; use rustc_span::{sym, Span, Symbol};
use rustc_target::spec::{PanicStrategy, TargetTriple}; use rustc_target::spec::{PanicStrategy, TargetTriple};

View File

@ -19,8 +19,6 @@
extern crate proc_macro; extern crate proc_macro;
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate rustc_middle; extern crate rustc_middle;

View File

@ -2,6 +2,7 @@ use crate::creader::CrateMetadataRef;
use decoder::Metadata; use decoder::Metadata;
use def_path_hash_map::DefPathHashMapRef; use def_path_hash_map::DefPathHashMapRef;
use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashMap;
use rustc_macros::{Decodable, Encodable, TyDecodable, TyEncodable};
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile; use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
use rustc_middle::middle::lib_features::FeatureStability; use rustc_middle::middle::lib_features::FeatureStability;
use table::TableBuilder; use table::TableBuilder;
@ -17,6 +18,7 @@ use rustc_hir::definitions::DefKey;
use rustc_hir::lang_items::LangItem; use rustc_hir::lang_items::LangItem;
use rustc_index::bit_set::BitSet; use rustc_index::bit_set::BitSet;
use rustc_index::IndexVec; use rustc_index::IndexVec;
use rustc_macros::{MetadataDecodable, MetadataEncodable};
use rustc_middle::metadata::ModChild; use rustc_middle::metadata::ModChild;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo}; use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};

View File

@ -49,6 +49,7 @@ use rustc_data_structures::fingerprint::{Fingerprint, PackedFingerprint};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd, ToStableHashKey}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd, ToStableHashKey};
use rustc_data_structures::AtomicRef; use rustc_data_structures::AtomicRef;
use rustc_hir::definitions::DefPathHash; use rustc_hir::definitions::DefPathHash;
use rustc_macros::{Decodable, Encodable};
use std::fmt; use std::fmt;
use std::hash::Hash; use std::hash::Hash;
@ -285,8 +286,7 @@ pub struct DepKindStruct<Tcx: DepContext> {
/// some independent path or string that persists between runs without /// some independent path or string that persists between runs without
/// the need to be mapped or unmapped. (This ensures we can serialize /// the need to be mapped or unmapped. (This ensures we can serialize
/// them even in the absence of a tcx.) /// them even in the absence of a tcx.)
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Encodable, Decodable)]
#[derive(Encodable, Decodable)]
pub struct WorkProductId { pub struct WorkProductId {
hash: Fingerprint, hash: Fingerprint,
} }

View File

@ -6,6 +6,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::{AtomicU32, AtomicU64, Lock, Lrc}; use rustc_data_structures::sync::{AtomicU32, AtomicU64, Lock, Lrc};
use rustc_data_structures::unord::UnordMap; use rustc_data_structures::unord::UnordMap;
use rustc_index::IndexVec; use rustc_index::IndexVec;
use rustc_macros::{Decodable, Encodable};
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder}; use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
use std::assert_matches::assert_matches; use std::assert_matches::assert_matches;
use std::collections::hash_map::Entry; use std::collections::hash_map::Entry;

View File

@ -9,8 +9,6 @@
extern crate tracing; extern crate tracing;
#[macro_use] #[macro_use]
extern crate rustc_data_structures; extern crate rustc_data_structures;
#[macro_use]
extern crate rustc_macros;
pub mod cache; pub mod cache;
pub mod dep_graph; pub mod dep_graph;

View File

@ -20,6 +20,7 @@ use rustc_data_structures::stable_hasher::Hash64;
use rustc_data_structures::sync::Lock; use rustc_data_structures::sync::Lock;
use rustc_errors::DiagInner; use rustc_errors::DiagInner;
use rustc_hir::def::DefKind; use rustc_hir::def::DefKind;
use rustc_macros::{Decodable, Encodable};
use rustc_span::def_id::DefId; use rustc_span::def_id::DefId;
use rustc_span::Span; use rustc_span::Span;
use thin_vec::ThinVec; use thin_vec::ThinVec;

View File

@ -15,6 +15,7 @@ use rustc_data_structures::stable_hasher::{StableOrd, ToStableHashKey};
use rustc_errors::emitter::HumanReadableErrorType; use rustc_errors::emitter::HumanReadableErrorType;
use rustc_errors::{ColorConfig, DiagArgValue, DiagCtxtFlags, IntoDiagArg}; use rustc_errors::{ColorConfig, DiagArgValue, DiagCtxtFlags, IntoDiagArg};
use rustc_feature::UnstableFeatures; use rustc_feature::UnstableFeatures;
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::edition::{Edition, DEFAULT_EDITION, EDITION_NAME_LIST, LATEST_STABLE_EDITION}; use rustc_span::edition::{Edition, DEFAULT_EDITION, EDITION_NAME_LIST, LATEST_STABLE_EDITION};
use rustc_span::source_map::FilePathMapping; use rustc_span::source_map::FilePathMapping;
use rustc_span::{FileName, FileNameDisplayPreference, RealFileName, SourceFileHashAlgorithm}; use rustc_span::{FileName, FileNameDisplayPreference, RealFileName, SourceFileHashAlgorithm};

View File

@ -10,6 +10,7 @@ use rustc_hir::def_id::{
CrateNum, DefId, LocalDefId, StableCrateId, StableCrateIdMap, LOCAL_CRATE, CrateNum, DefId, LocalDefId, StableCrateId, StableCrateIdMap, LOCAL_CRATE,
}; };
use rustc_hir::definitions::{DefKey, DefPath, DefPathHash, Definitions}; use rustc_hir::definitions::{DefKey, DefPath, DefPathHash, Definitions};
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::symbol::Symbol; use rustc_span::symbol::Symbol;
use rustc_span::Span; use rustc_span::Span;
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;

View File

@ -6,7 +6,7 @@ use rustc_errors::{
codes::*, Diag, DiagCtxt, DiagMessage, Diagnostic, EmissionGuarantee, ErrorGuaranteed, Level, codes::*, Diag, DiagCtxt, DiagMessage, Diagnostic, EmissionGuarantee, ErrorGuaranteed, Level,
MultiSpan, MultiSpan,
}; };
use rustc_macros::Diagnostic; use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::{Span, Symbol}; use rustc_span::{Span, Symbol};
use rustc_target::spec::{SplitDebuginfo, StackProtector, TargetTriple}; use rustc_target::spec::{SplitDebuginfo, StackProtector, TargetTriple};

View File

@ -6,8 +6,6 @@
#![feature(iter_intersperse)] #![feature(iter_intersperse)]
#![allow(internal_features)] #![allow(internal_features)]
#[macro_use]
extern crate rustc_macros;
pub mod errors; pub mod errors;
#[macro_use] #[macro_use]

View File

@ -1,5 +1,6 @@
use crate::filesearch::make_target_lib_path; use crate::filesearch::make_target_lib_path;
use crate::EarlyDiagCtxt; use crate::EarlyDiagCtxt;
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_target::spec::TargetTriple; use rustc_target::spec::TargetTriple;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};

View File

@ -1,6 +1,7 @@
use crate::session::Session; use crate::session::Session;
use rustc_data_structures::profiling::VerboseTimingGuard; use rustc_data_structures::profiling::VerboseTimingGuard;
use rustc_fs_util::try_canonicalize; use rustc_fs_util::try_canonicalize;
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use std::{ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},
sync::OnceLock, sync::OnceLock,

View File

@ -1,3 +1,4 @@
use rustc_macros::{current_rustc_version, Decodable, Encodable, HashStable_Generic};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[derive(Encodable, Decodable, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Encodable, Decodable, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]

View File

@ -6,7 +6,7 @@ use rustc_data_structures::stable_hasher::{
use rustc_data_structures::unhash::Unhasher; use rustc_data_structures::unhash::Unhasher;
use rustc_data_structures::AtomicRef; use rustc_data_structures::AtomicRef;
use rustc_index::Idx; use rustc_index::Idx;
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_serialize::{Decodable, Encodable}; use rustc_serialize::{Decodable, Encodable};
use std::fmt; use std::fmt;
use std::hash::{BuildHasherDefault, Hash, Hasher}; use std::hash::{BuildHasherDefault, Hash, Hasher};

View File

@ -1,7 +1,7 @@
use std::fmt; use std::fmt;
use std::str::FromStr; use std::str::FromStr;
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
/// The edition of the compiler. (See [RFC 2052](https://github.com/rust-lang/rfcs/blob/master/text/2052-epochs.md).) /// The edition of the compiler. (See [RFC 2052](https://github.com/rust-lang/rfcs/blob/master/text/2052-epochs.md).)
#[derive(Clone, Copy, Hash, PartialEq, PartialOrd, Debug, Encodable, Decodable, Eq)] #[derive(Clone, Copy, Hash, PartialEq, PartialOrd, Debug, Encodable, Decodable, Eq)]

View File

@ -34,7 +34,7 @@ use rustc_data_structures::stable_hasher::{Hash64, HashStable, HashingControls,
use rustc_data_structures::sync::{Lock, Lrc, WorkerLocal}; use rustc_data_structures::sync::{Lock, Lrc, WorkerLocal};
use rustc_data_structures::unhash::UnhashMap; use rustc_data_structures::unhash::UnhashMap;
use rustc_index::IndexVec; use rustc_index::IndexVec;
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use std::cell::RefCell; use std::cell::RefCell;
use std::collections::hash_map::Entry; use std::collections::hash_map::Entry;

View File

@ -35,14 +35,11 @@
extern crate self as rustc_span; extern crate self as rustc_span;
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;
use rustc_data_structures::{outline, AtomicRef}; use rustc_data_structures::{outline, AtomicRef};
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_serialize::opaque::{FileEncoder, MemDecoder}; use rustc_serialize::opaque::{FileEncoder, MemDecoder};
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};

View File

@ -12,6 +12,7 @@
use crate::*; use crate::*;
use rustc_data_structures::sync::{IntoDynSyncSend, MappedReadGuard, ReadGuard, RwLock}; use rustc_data_structures::sync::{IntoDynSyncSend, MappedReadGuard, ReadGuard, RwLock};
use rustc_data_structures::unhash::UnhashMap; use rustc_data_structures::unhash::UnhashMap;
use rustc_macros::{Decodable, Encodable};
use std::fs; use std::fs;
use std::io::{self, BorrowedBuf, Read}; use std::io::{self, BorrowedBuf, Read};
use std::path; use std::path;

View File

@ -8,7 +8,7 @@ use rustc_data_structures::stable_hasher::{
HashStable, StableCompare, StableHasher, ToStableHashKey, HashStable, StableCompare, StableHasher, ToStableHashKey,
}; };
use rustc_data_structures::sync::Lock; use rustc_data_structures::sync::Lock;
use rustc_macros::HashStable_Generic; use rustc_macros::{symbols, Decodable, Encodable, HashStable_Generic};
use std::fmt; use std::fmt;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};

View File

@ -1,6 +1,7 @@
use crate::abi::{self, Abi, Align, FieldsShape, Size}; use crate::abi::{self, Abi, Align, FieldsShape, Size};
use crate::abi::{HasDataLayout, TyAbiInterface, TyAndLayout}; use crate::abi::{HasDataLayout, TyAbiInterface, TyAndLayout};
use crate::spec::{self, HasTargetSpec, HasWasmCAbiOpt}; use crate::spec::{self, HasTargetSpec, HasWasmCAbiOpt};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;
use std::str::FromStr; use std::str::FromStr;
@ -100,6 +101,8 @@ pub use attr_impl::ArgAttribute;
#[allow(non_upper_case_globals)] #[allow(non_upper_case_globals)]
#[allow(unused)] #[allow(unused)]
mod attr_impl { mod attr_impl {
use rustc_macros::HashStable_Generic;
// The subset of llvm::Attribute needed for arguments, packed into a bitfield. // The subset of llvm::Attribute needed for arguments, packed into a bitfield.
#[derive(Clone, Copy, Default, Hash, PartialEq, Eq, HashStable_Generic)] #[derive(Clone, Copy, Default, Hash, PartialEq, Eq, HashStable_Generic)]
pub struct ArgAttribute(u8); pub struct ArgAttribute(u8);

View File

@ -1,7 +1,6 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use crate::spec::{RelocModel, Target}; use crate::spec::{RelocModel, Target};
use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::fx::FxIndexSet;
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,7 +1,6 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use crate::spec::{RelocModel, Target}; use crate::spec::{RelocModel, Target};
use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::fx::FxIndexSet;
use rustc_macros::HashStable_Generic;
use rustc_span::{sym, Symbol}; use rustc_span::{sym, Symbol};
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,7 +1,7 @@
use crate::spec::Target; use crate::spec::Target;
use crate::{abi::Size, spec::RelocModel}; use crate::{abi::Size, spec::RelocModel};
use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;
use std::str::FromStr; use std::str::FromStr;
@ -24,7 +24,7 @@ macro_rules! def_reg_class {
$class:ident, $class:ident,
)* )*
}) => { }) => {
#[derive(Copy, Clone, Encodable, Decodable, Debug, Eq, PartialEq, PartialOrd, Hash, HashStable_Generic)] #[derive(Copy, Clone, rustc_macros::Encodable, rustc_macros::Decodable, Debug, Eq, PartialEq, PartialOrd, Hash, rustc_macros::HashStable_Generic)]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub enum $arch_regclass { pub enum $arch_regclass {
$($class,)* $($class,)*
@ -73,7 +73,7 @@ macro_rules! def_regs {
)* )*
}) => { }) => {
#[allow(unreachable_code)] #[allow(unreachable_code)]
#[derive(Copy, Clone, Encodable, Decodable, Debug, Eq, PartialEq, PartialOrd, Hash, HashStable_Generic)] #[derive(Copy, Clone, rustc_macros::Encodable, rustc_macros::Decodable, Debug, Eq, PartialEq, PartialOrd, Hash, rustc_macros::HashStable_Generic)]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub enum $arch_reg { pub enum $arch_reg {
$($reg,)* $($reg,)*

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
def_reg_class! { def_reg_class! {

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,7 +1,6 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use crate::spec::{RelocModel, Target}; use crate::spec::{RelocModel, Target};
use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::fx::FxIndexSet;
use rustc_macros::HashStable_Generic;
use rustc_span::{sym, Symbol}; use rustc_span::{sym, Symbol};
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
def_reg_class! { def_reg_class! {

View File

@ -1,5 +1,4 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
def_reg_class! { def_reg_class! {

View File

@ -1,7 +1,6 @@
use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use crate::spec::{RelocModel, Target}; use crate::spec::{RelocModel, Target};
use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::fx::FxIndexSet;
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol; use rustc_span::Symbol;
use std::fmt; use std::fmt;

View File

@ -20,9 +20,6 @@
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
#[macro_use]
extern crate rustc_macros;
#[macro_use] #[macro_use]
extern crate tracing; extern crate tracing;

View File

@ -1,6 +1,6 @@
use std::fmt; use std::fmt;
use rustc_macros::HashStable_Generic; use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
use rustc_span::{Span, Symbol}; use rustc_span::{Span, Symbol};

View File

@ -40,6 +40,7 @@ use crate::json::{Json, ToJson};
use crate::spec::abi::Abi; use crate::spec::abi::Abi;
use crate::spec::crt_objects::CrtObjects; use crate::spec::crt_objects::CrtObjects;
use rustc_fs_util::try_canonicalize; use rustc_fs_util::try_canonicalize;
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::symbol::{kw, sym, Symbol};
use serde_json::Value; use serde_json::Value;
@ -51,8 +52,6 @@ use std::path::{Path, PathBuf};
use std::str::FromStr; use std::str::FromStr;
use std::{fmt, io}; use std::{fmt, io};
use rustc_macros::HashStable_Generic;
pub mod abi; pub mod abi;
pub mod crt_objects; pub mod crt_objects;

View File

@ -3,7 +3,7 @@ use rustc_errors::{
codes::*, Applicability, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level, codes::*, Applicability, Diag, DiagCtxt, Diagnostic, EmissionGuarantee, Level,
SubdiagMessageOp, Subdiagnostic, SubdiagMessageOp, Subdiagnostic,
}; };
use rustc_macros::Diagnostic; use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_middle::ty::{self, ClosureKind, PolyTraitRef, Ty}; use rustc_middle::ty::{self, ClosureKind, PolyTraitRef, Ty};
use rustc_span::{Span, Symbol}; use rustc_span::{Span, Symbol};

View File

@ -1,10 +1,9 @@
use crate::traits::query::evaluate_obligation::InferCtxtExt as _; use crate::traits::query::evaluate_obligation::InferCtxtExt as _;
use crate::traits::{self, ObligationCtxt, SelectionContext}; use crate::traits::{self, ObligationCtxt, SelectionContext, TraitEngineExt as _};
use crate::traits::TraitEngineExt as _;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_hir::lang_items::LangItem; use rustc_hir::lang_items::LangItem;
use rustc_infer::traits::{Obligation, TraitEngine, TraitEngineExt as _}; use rustc_infer::traits::{Obligation, TraitEngine, TraitEngineExt as _};
use rustc_macros::extension;
use rustc_middle::arena::ArenaAllocatable; use rustc_middle::arena::ArenaAllocatable;
use rustc_middle::infer::canonical::{Canonical, CanonicalQueryResponse, QueryResponse}; use rustc_middle::infer::canonical::{Canonical, CanonicalQueryResponse, QueryResponse};
use rustc_middle::traits::query::NoSolution; use rustc_middle::traits::query::NoSolution;

View File

@ -29,8 +29,6 @@
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
#![recursion_limit = "512"] // For rustdoc #![recursion_limit = "512"] // For rustdoc
#[macro_use]
extern crate rustc_macros;
#[cfg(target_pointer_width = "64")] #[cfg(target_pointer_width = "64")]
#[macro_use] #[macro_use]
extern crate rustc_data_structures; extern crate rustc_data_structures;

View File

@ -1,5 +1,6 @@
use rustc_infer::infer::outlives::env::OutlivesEnvironment; use rustc_infer::infer::outlives::env::OutlivesEnvironment;
use rustc_infer::infer::{InferCtxt, RegionResolutionError}; use rustc_infer::infer::{InferCtxt, RegionResolutionError};
use rustc_macros::extension;
use rustc_middle::traits::query::NoSolution; use rustc_middle::traits::query::NoSolution;
use rustc_middle::traits::ObligationCause; use rustc_middle::traits::ObligationCause;

View File

@ -4,6 +4,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_hir::LangItem; use rustc_hir::LangItem;
use rustc_hir::{def_id::DefId, Movability, Mutability}; use rustc_hir::{def_id::DefId, Movability, Mutability};
use rustc_infer::traits::query::NoSolution; use rustc_infer::traits::query::NoSolution;
use rustc_macros::{TypeFoldable, TypeVisitable};
use rustc_middle::traits::solve::Goal; use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::{ use rustc_middle::ty::{
self, ToPredicate, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, self, ToPredicate, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable,

View File

@ -9,6 +9,7 @@ use rustc_infer::infer::{
use rustc_infer::traits::query::NoSolution; use rustc_infer::traits::query::NoSolution;
use rustc_infer::traits::solve::{MaybeCause, NestedNormalizationGoals}; use rustc_infer::traits::solve::{MaybeCause, NestedNormalizationGoals};
use rustc_infer::traits::ObligationCause; use rustc_infer::traits::ObligationCause;
use rustc_macros::{extension, HashStable};
use rustc_middle::infer::canonical::CanonicalVarInfos; use rustc_middle::infer::canonical::CanonicalVarInfos;
use rustc_middle::infer::unify_key::ConstVariableOrigin; use rustc_middle::infer::unify_key::ConstVariableOrigin;
use rustc_middle::traits::solve::inspect; use rustc_middle::traits::solve::inspect;

View File

@ -4,6 +4,7 @@ use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt};
use rustc_infer::traits::{ use rustc_infer::traits::{
Obligation, PolyTraitObligation, PredicateObligation, Selection, SelectionResult, TraitEngine, Obligation, PolyTraitObligation, PredicateObligation, Selection, SelectionResult, TraitEngine,
}; };
use rustc_macros::extension;
use rustc_middle::traits::solve::{CandidateSource, CanonicalInput, Certainty, Goal}; use rustc_middle::traits::solve::{CandidateSource, CanonicalInput, Certainty, Goal};
use rustc_middle::traits::{ use rustc_middle::traits::{
BuiltinImplSource, ImplSource, ImplSourceUserDefinedData, ObligationCause, SelectionError, BuiltinImplSource, ImplSource, ImplSourceUserDefinedData, ObligationCause, SelectionError,

View File

@ -14,6 +14,7 @@ use rustc_ast_ir::visit::VisitorResult;
use rustc_infer::infer::resolve::EagerResolver; use rustc_infer::infer::resolve::EagerResolver;
use rustc_infer::infer::type_variable::TypeVariableOrigin; use rustc_infer::infer::type_variable::TypeVariableOrigin;
use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, InferOk}; use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, InferOk};
use rustc_macros::extension;
use rustc_middle::infer::unify_key::ConstVariableOrigin; use rustc_middle::infer::unify_key::ConstVariableOrigin;
use rustc_middle::traits::query::NoSolution; use rustc_middle::traits::query::NoSolution;
use rustc_middle::traits::solve::{inspect, QueryResult}; use rustc_middle::traits::solve::{inspect, QueryResult};

View File

@ -16,6 +16,7 @@
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_infer::infer::canonical::{Canonical, CanonicalVarValues}; use rustc_infer::infer::canonical::{Canonical, CanonicalVarValues};
use rustc_infer::traits::query::NoSolution; use rustc_infer::traits::query::NoSolution;
use rustc_macros::extension;
use rustc_middle::infer::canonical::CanonicalVarInfos; use rustc_middle::infer::canonical::CanonicalVarInfos;
use rustc_middle::traits::solve::{ use rustc_middle::traits::solve::{
CanonicalResponse, Certainty, ExternalConstraintsData, Goal, GoalSource, QueryResult, Response, CanonicalResponse, Certainty, ExternalConstraintsData, Goal, GoalSource, QueryResult, Response,

View File

@ -19,6 +19,7 @@ use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, InferOk};
use rustc_infer::traits::{ use rustc_infer::traits::{
FulfillmentError, Obligation, ObligationCause, PredicateObligation, TraitEngineExt as _, FulfillmentError, Obligation, ObligationCause, PredicateObligation, TraitEngineExt as _,
}; };
use rustc_macros::extension;
use rustc_middle::arena::ArenaAllocatable; use rustc_middle::arena::ArenaAllocatable;
use rustc_middle::traits::query::NoSolution; use rustc_middle::traits::query::NoSolution;
use rustc_middle::ty::error::TypeError; use rustc_middle::ty::error::TypeError;

View File

@ -4,6 +4,7 @@ use crate::traits::{Obligation, ObligationCause, ObligationCtxt};
use rustc_errors::{codes::*, pluralize, struct_span_code_err, Applicability, Diag}; use rustc_errors::{codes::*, pluralize, struct_span_code_err, Applicability, Diag};
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::Node; use rustc_hir::Node;
use rustc_macros::extension;
use rustc_middle::ty::{self, Ty}; use rustc_middle::ty::{self, Ty};
use rustc_span::{Span, DUMMY_SP}; use rustc_span::{Span, DUMMY_SP};

View File

@ -9,6 +9,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{codes::*, struct_span_code_err, ErrorGuaranteed}; use rustc_errors::{codes::*, struct_span_code_err, ErrorGuaranteed};
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_macros::{extension, LintDiagnostic};
use rustc_middle::ty::GenericArgsRef; use rustc_middle::ty::GenericArgsRef;
use rustc_middle::ty::{self, GenericParamDefKind, TyCtxt}; use rustc_middle::ty::{self, GenericParamDefKind, TyCtxt};
use rustc_parse_format::{ParseMode, Parser, Piece, Position}; use rustc_parse_format::{ParseMode, Parser, Piece, Position};

View File

@ -26,6 +26,7 @@ use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, Expr, HirId
use rustc_infer::infer::error_reporting::TypeErrCtxt; use rustc_infer::infer::error_reporting::TypeErrCtxt;
use rustc_infer::infer::type_variable::TypeVariableOrigin; use rustc_infer::infer::type_variable::TypeVariableOrigin;
use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferOk}; use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferOk};
use rustc_macros::extension;
use rustc_middle::hir::map; use rustc_middle::hir::map;
use rustc_middle::traits::IsConstable; use rustc_middle::traits::IsConstable;
use rustc_middle::ty::error::TypeError::{self, Sorts}; use rustc_middle::ty::error::TypeError::{self, Sorts};

View File

@ -32,6 +32,7 @@ use rustc_hir::intravisit::Visitor;
use rustc_hir::{GenericParam, Item, Node}; use rustc_hir::{GenericParam, Item, Node};
use rustc_infer::infer::error_reporting::TypeErrCtxt; use rustc_infer::infer::error_reporting::TypeErrCtxt;
use rustc_infer::infer::{InferOk, TypeTrace}; use rustc_infer::infer::{InferOk, TypeTrace};
use rustc_macros::extension;
use rustc_middle::traits::select::OverflowError; use rustc_middle::traits::select::OverflowError;
use rustc_middle::traits::SignatureMismatchData; use rustc_middle::traits::SignatureMismatchData;
use rustc_middle::ty::abstract_const::NotConstEvaluatable; use rustc_middle::ty::abstract_const::NotConstEvaluatable;

View File

@ -8,6 +8,7 @@ use rustc_infer::infer::at::At;
use rustc_infer::infer::InferOk; use rustc_infer::infer::InferOk;
use rustc_infer::traits::PredicateObligation; use rustc_infer::traits::PredicateObligation;
use rustc_infer::traits::{FulfillmentError, Normalized, Obligation, TraitEngine}; use rustc_infer::traits::{FulfillmentError, Normalized, Obligation, TraitEngine};
use rustc_macros::extension;
use rustc_middle::traits::{ObligationCause, ObligationCauseCode, Reveal}; use rustc_middle::traits::{ObligationCause, ObligationCauseCode, Reveal};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFolder}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeFolder};
use rustc_middle::ty::{TypeFoldable, TypeSuperFoldable, TypeVisitable, TypeVisitableExt}; use rustc_middle::ty::{TypeFoldable, TypeSuperFoldable, TypeVisitable, TypeVisitableExt};

View File

@ -3,6 +3,7 @@ use crate::traits::{ObligationCause, ObligationCtxt};
use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::fx::FxIndexSet;
use rustc_infer::infer::resolve::OpportunisticRegionResolver; use rustc_infer::infer::resolve::OpportunisticRegionResolver;
use rustc_infer::infer::InferOk; use rustc_infer::infer::InferOk;
use rustc_macros::extension;
use rustc_middle::infer::canonical::{OriginalQueryValues, QueryRegionConstraints}; use rustc_middle::infer::canonical::{OriginalQueryValues, QueryRegionConstraints};
use rustc_middle::ty::{self, ParamEnv, Ty, TypeFolder, TypeVisitableExt}; use rustc_middle::ty::{self, ParamEnv, Ty, TypeFolder, TypeVisitableExt};
use rustc_span::def_id::LocalDefId; use rustc_span::def_id::LocalDefId;

View File

@ -1,4 +1,5 @@
use rustc_infer::traits::{TraitEngine, TraitEngineExt}; use rustc_infer::traits::{TraitEngine, TraitEngineExt};
use rustc_macros::extension;
use crate::infer::canonical::OriginalQueryValues; use crate::infer::canonical::OriginalQueryValues;
use crate::infer::InferCtxt; use crate::infer::InferCtxt;

View File

@ -13,6 +13,7 @@ use crate::traits::{ObligationCause, PredicateObligation, Reveal};
use rustc_data_structures::sso::SsoHashMap; use rustc_data_structures::sso::SsoHashMap;
use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_infer::traits::Normalized; use rustc_infer::traits::Normalized;
use rustc_macros::extension;
use rustc_middle::ty::fold::{FallibleTypeFolder, TypeFoldable, TypeSuperFoldable}; use rustc_middle::ty::fold::{FallibleTypeFolder, TypeFoldable, TypeSuperFoldable};
use rustc_middle::ty::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitableExt}; use rustc_middle::ty::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitableExt};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitor}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitor};

Some files were not shown because too many files have changed in this diff Show More