Rename libsyntax_ext
and libsyntax_expand
in code
This commit is contained in:
parent
b9a9c5b4fd
commit
a2823e3af6
52 changed files with 69 additions and 72 deletions
|
@ -19,6 +19,6 @@ rustc_parse = { path = "../librustc_parse" }
|
|||
rustc_target = { path = "../librustc_target" }
|
||||
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
||||
syntax = { path = "../libsyntax" }
|
||||
syntax_expand = { path = "../librustc_expand", package = "rustc_expand" }
|
||||
rustc_expand = { path = "../librustc_expand" }
|
||||
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
|
||||
rustc_error_codes = { path = "../librustc_error_codes" }
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
use State::*;
|
||||
|
||||
use errors::{DiagnosticBuilder, PResult};
|
||||
use rustc_expand::base::*;
|
||||
use rustc_parse::parser::Parser;
|
||||
use syntax::ast::{self, AsmDialect};
|
||||
use syntax::ptr::P;
|
||||
|
@ -10,7 +11,6 @@ use syntax::symbol::{kw, sym, Symbol};
|
|||
use syntax::token::{self, Token};
|
||||
use syntax::tokenstream::{self, TokenStream};
|
||||
use syntax::{span_err, struct_span_err};
|
||||
use syntax_expand::base::*;
|
||||
use syntax_pos::Span;
|
||||
|
||||
use rustc_error_codes::*;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use errors::{Applicability, DiagnosticBuilder};
|
||||
|
||||
use rustc_expand::base::*;
|
||||
use rustc_parse::parser::Parser;
|
||||
use syntax::ast::{self, *};
|
||||
use syntax::print::pprust;
|
||||
|
@ -7,7 +8,6 @@ use syntax::ptr::P;
|
|||
use syntax::symbol::{sym, Symbol};
|
||||
use syntax::token::{self, TokenKind};
|
||||
use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree};
|
||||
use syntax_expand::base::*;
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
||||
pub fn expand_assert<'cx>(
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
/// current compilation environment.
|
||||
use errors::DiagnosticBuilder;
|
||||
|
||||
use rustc_expand::base::{self, *};
|
||||
use syntax::ast;
|
||||
use syntax::attr;
|
||||
use syntax::token;
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_expand::base::{self, *};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_cfg(
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
//! Attributes injected into the crate root from command line using `-Z crate-attr`.
|
||||
|
||||
use rustc_expand::panictry;
|
||||
use syntax::ast::{self, AttrItem, AttrStyle};
|
||||
use syntax::attr::mk_attr;
|
||||
use syntax::sess::ParseSess;
|
||||
use syntax::token;
|
||||
use syntax_expand::panictry;
|
||||
use syntax_pos::FileName;
|
||||
|
||||
pub fn inject(mut krate: ast::Crate, parse_sess: &ParseSess, attrs: &[String]) -> ast::Crate {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// The compiler code necessary to support the compile_error! extension.
|
||||
|
||||
use rustc_expand::base::{self, *};
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_expand::base::{self, *};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_compile_error<'cx>(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use rustc_expand::base::{self, DummyResult};
|
||||
use syntax::ast;
|
||||
use syntax::symbol::Symbol;
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_expand::base::{self, DummyResult};
|
||||
|
||||
use std::string::String;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use rustc_expand::base::{self, *};
|
||||
use syntax::ast;
|
||||
use syntax::ptr::P;
|
||||
use syntax::token::{self, Token};
|
||||
use syntax::tokenstream::{TokenStream, TokenTree};
|
||||
use syntax_expand::base::{self, *};
|
||||
use syntax_pos::symbol::Symbol;
|
||||
use syntax_pos::Span;
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::path_std;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::MetaItem;
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_copy(
|
||||
|
|
|
@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::path_std;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{self, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::{kw, sym, Symbol};
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_clone(
|
||||
|
|
|
@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::path_std;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{self, Expr, GenericArg, Ident, MetaItem};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::{sym, Symbol};
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_eq(
|
||||
|
|
|
@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::path_std;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{self, Expr, MetaItem};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::sym;
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_ord(
|
||||
|
|
|
@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::{path_local, path_std};
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{BinOpKind, Expr, MetaItem};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::sym;
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_partial_eq(
|
||||
|
|
|
@ -4,10 +4,10 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::{path_local, path_std, pathvec_std};
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{self, BinOpKind, Expr, MetaItem};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::{sym, Symbol};
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_partial_ord(
|
||||
|
|
|
@ -2,11 +2,11 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::path_std;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{self, Ident};
|
||||
use syntax::ast::{Expr, MetaItem};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::sym;
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
||||
pub fn expand_deriving_debug(
|
||||
|
|
|
@ -4,11 +4,11 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::pathvec_std;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast;
|
||||
use syntax::ast::{Expr, MetaItem, Mutability};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::Symbol;
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_rustc_decodable(
|
||||
|
|
|
@ -2,11 +2,11 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::path_std;
|
||||
|
||||
use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt};
|
||||
use syntax::ast::{Expr, MetaItem};
|
||||
use syntax::ptr::P;
|
||||
use syntax::span_err;
|
||||
use syntax::symbol::{kw, sym};
|
||||
use syntax_expand::base::{Annotatable, DummyResult, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
use rustc_error_codes::*;
|
||||
|
|
|
@ -89,10 +89,10 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::pathvec_std;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{Expr, ExprKind, MetaItem, Mutability};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::Symbol;
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_rustc_encodable(
|
||||
|
|
|
@ -181,6 +181,7 @@ use std::cell::RefCell;
|
|||
use std::iter;
|
||||
use std::vec;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{self, BinOpKind, EnumDef, Expr, Generics, Ident, PatKind};
|
||||
use syntax::ast::{GenericArg, GenericParamKind, VariantData};
|
||||
use syntax::attr;
|
||||
|
@ -189,7 +190,6 @@ use syntax::sess::ParseSess;
|
|||
use syntax::source_map::respan;
|
||||
use syntax::symbol::{kw, sym, Symbol};
|
||||
use syntax::util::map_in_place::MapInPlace;
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
use ty::{LifetimeBounds, Path, Ptr, PtrTy, Self_, Ty};
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
pub use PtrTy::*;
|
||||
pub use Ty::*;
|
||||
|
||||
use rustc_expand::base::ExtCtxt;
|
||||
use syntax::ast::{self, Expr, GenericArg, GenericParamKind, Generics, Ident, SelfKind};
|
||||
use syntax::ptr::P;
|
||||
use syntax::source_map::{respan, DUMMY_SP};
|
||||
use syntax_expand::base::ExtCtxt;
|
||||
use syntax_pos::symbol::kw;
|
||||
use syntax_pos::Span;
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
|
|||
use crate::deriving::generic::*;
|
||||
use crate::deriving::{self, path_std, pathvec_std};
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{Expr, MetaItem, Mutability};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::sym;
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_deriving_hash(
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//! The compiler code necessary to implement the `#[derive]` extensions.
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt, MultiItemModifier};
|
||||
use syntax::ast::{self, ItemKind, MetaItem};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::{sym, Symbol};
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt, MultiItemModifier};
|
||||
use syntax_pos::Span;
|
||||
|
||||
macro path_local($x:ident) {
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
// interface.
|
||||
//
|
||||
|
||||
use rustc_expand::base::{self, *};
|
||||
use syntax::ast::{self, GenericArg, Ident};
|
||||
use syntax::symbol::{kw, sym, Symbol};
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_expand::base::{self, *};
|
||||
use syntax_pos::Span;
|
||||
|
||||
use std::env;
|
||||
|
|
|
@ -7,12 +7,12 @@ use errors::pluralize;
|
|||
use errors::Applicability;
|
||||
use errors::DiagnosticBuilder;
|
||||
|
||||
use rustc_expand::base::{self, *};
|
||||
use syntax::ast;
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::{sym, Symbol};
|
||||
use syntax::token;
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_expand::base::{self, *};
|
||||
use syntax_pos::{MultiSpan, Span};
|
||||
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use crate::util::check_builtin_macro_attribute;
|
||||
|
||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax::ast::{self, Attribute, Expr, FnHeader, FnSig, Generics, Ident, Param};
|
||||
use syntax::ast::{ItemKind, Mutability, Stmt, Ty, TyKind, Unsafety};
|
||||
use syntax::expand::allocator::{AllocatorKind, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};
|
||||
use syntax::ptr::P;
|
||||
use syntax::symbol::{kw, sym, Symbol};
|
||||
use syntax_expand::base::{Annotatable, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand(
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
/// therefore apply.
|
||||
use errors::DiagnosticBuilder;
|
||||
|
||||
use rustc_expand::base::{self, *};
|
||||
use smallvec::smallvec;
|
||||
use syntax::ast;
|
||||
use syntax::ptr::P;
|
||||
use syntax::source_map::respan;
|
||||
use syntax::token;
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_expand::base::{self, *};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_global_asm<'cx>(
|
||||
|
|
|
@ -13,11 +13,11 @@ extern crate proc_macro;
|
|||
|
||||
use crate::deriving::*;
|
||||
|
||||
use rustc_expand::base::{MacroExpanderFn, Resolver, SyntaxExtension, SyntaxExtensionKind};
|
||||
use rustc_expand::proc_macro::BangProcMacro;
|
||||
use syntax::ast::Ident;
|
||||
use syntax::edition::Edition;
|
||||
use syntax::symbol::sym;
|
||||
use syntax_expand::base::{MacroExpanderFn, Resolver, SyntaxExtension, SyntaxExtensionKind};
|
||||
use syntax_expand::proc_macro::BangProcMacro;
|
||||
|
||||
mod asm;
|
||||
mod assert;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use rustc_expand::base;
|
||||
use syntax::print;
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_expand::base;
|
||||
use syntax_pos;
|
||||
|
||||
pub fn expand_log_syntax<'cx>(
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
use std::mem;
|
||||
|
||||
use rustc_expand::base::{ExtCtxt, Resolver};
|
||||
use rustc_expand::expand::{AstFragment, ExpansionConfig};
|
||||
use smallvec::smallvec;
|
||||
use syntax::ast::{self, Ident};
|
||||
use syntax::attr;
|
||||
|
@ -9,8 +11,6 @@ use syntax::ptr::P;
|
|||
use syntax::sess::ParseSess;
|
||||
use syntax::symbol::{kw, sym};
|
||||
use syntax::visit::{self, Visitor};
|
||||
use syntax_expand::base::{ExtCtxt, Resolver};
|
||||
use syntax_expand::expand::{AstFragment, ExpansionConfig};
|
||||
use syntax_pos::hygiene::AstPass;
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use rustc_expand::base::{self, *};
|
||||
use rustc_expand::panictry;
|
||||
use rustc_parse::{self, new_sub_parser_from_file, parser::Parser, DirectoryOwnership};
|
||||
use syntax::ast;
|
||||
use syntax::early_buffered_lints::INCOMPLETE_INCLUDE;
|
||||
|
@ -6,8 +8,6 @@ use syntax::ptr::P;
|
|||
use syntax::symbol::Symbol;
|
||||
use syntax::token;
|
||||
use syntax::tokenstream::TokenStream;
|
||||
use syntax_expand::base::{self, *};
|
||||
use syntax_expand::panictry;
|
||||
|
||||
use smallvec::SmallVec;
|
||||
use syntax_pos::{self, Pos, Span};
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use rustc_expand::base::{ExtCtxt, Resolver};
|
||||
use rustc_expand::expand::ExpansionConfig;
|
||||
use syntax::edition::Edition;
|
||||
use syntax::ptr::P;
|
||||
use syntax::sess::ParseSess;
|
||||
use syntax::symbol::{kw, sym, Ident, Symbol};
|
||||
use syntax::{ast, attr};
|
||||
use syntax_expand::base::{ExtCtxt, Resolver};
|
||||
use syntax_expand::expand::ExpansionConfig;
|
||||
use syntax_pos::hygiene::AstPass;
|
||||
use syntax_pos::DUMMY_SP;
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
/// Ideally, this code would be in libtest but for efficiency and error messages it lives here.
|
||||
use crate::util::check_builtin_macro_attribute;
|
||||
|
||||
use rustc_expand::base::*;
|
||||
use syntax::ast;
|
||||
use syntax::attr;
|
||||
use syntax::print::pprust;
|
||||
use syntax::source_map::respan;
|
||||
use syntax::symbol::{sym, Symbol};
|
||||
use syntax_expand::base::*;
|
||||
use syntax_pos::Span;
|
||||
|
||||
use std::iter;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Code that generates a test runner to run all the tests in a crate
|
||||
|
||||
use log::debug;
|
||||
use rustc_expand::base::{ExtCtxt, Resolver};
|
||||
use rustc_expand::expand::{AstFragment, ExpansionConfig};
|
||||
use rustc_feature::Features;
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
use smallvec::{smallvec, SmallVec};
|
||||
|
@ -12,8 +14,6 @@ use syntax::ptr::P;
|
|||
use syntax::sess::ParseSess;
|
||||
use syntax::source_map::respan;
|
||||
use syntax::symbol::{sym, Symbol};
|
||||
use syntax_expand::base::{ExtCtxt, Resolver};
|
||||
use syntax_expand::expand::{AstFragment, ExpansionConfig};
|
||||
use syntax_pos::hygiene::{AstPass, SyntaxContext, Transparency};
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use rustc_expand::base::{self, ExtCtxt};
|
||||
use syntax::symbol::kw;
|
||||
use syntax::tokenstream::{TokenStream, TokenTree};
|
||||
use syntax_expand::base::{self, ExtCtxt};
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn expand_trace_macros(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use rustc_expand::base::ExtCtxt;
|
||||
use rustc_feature::AttributeTemplate;
|
||||
use rustc_parse::validate_attr;
|
||||
use syntax::ast::MetaItem;
|
||||
use syntax_expand::base::ExtCtxt;
|
||||
use syntax_pos::Symbol;
|
||||
|
||||
pub fn check_builtin_macro_attribute(ecx: &ExtCtxt<'_>, meta_item: &MetaItem, name: Symbol) {
|
||||
|
|
|
@ -30,5 +30,5 @@ rustc_session = { path = "../librustc_session" }
|
|||
rustc_target = { path = "../librustc_target" }
|
||||
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
|
||||
syntax = { path = "../libsyntax" }
|
||||
syntax_expand = { path = "../librustc_expand", package = "rustc_expand" }
|
||||
rustc_expand = { path = "../librustc_expand" }
|
||||
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
|
||||
|
|
|
@ -14,8 +14,8 @@ log = "0.4"
|
|||
rayon = { version = "0.3.0", package = "rustc-rayon" }
|
||||
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
||||
syntax = { path = "../libsyntax" }
|
||||
syntax_ext = { path = "../librustc_builtin_macros", package = "rustc_builtin_macros" }
|
||||
syntax_expand = { path = "../librustc_expand", package = "rustc_expand" }
|
||||
rustc_builtin_macros = { path = "../librustc_builtin_macros" }
|
||||
rustc_expand = { path = "../librustc_expand" }
|
||||
rustc_parse = { path = "../librustc_parse" }
|
||||
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
|
||||
rustc_serialize = { path = "../libserialize", package = "serialize" }
|
||||
|
|
|
@ -19,12 +19,14 @@ use rustc::traits;
|
|||
use rustc::ty::steal::Steal;
|
||||
use rustc::ty::{self, AllArenas, GlobalCtxt, ResolverOutputs, TyCtxt};
|
||||
use rustc::util::common::{time, ErrorReported};
|
||||
use rustc_builtin_macros;
|
||||
use rustc_codegen_ssa::back::link::emit_metadata;
|
||||
use rustc_codegen_utils::codegen_backend::CodegenBackend;
|
||||
use rustc_codegen_utils::link::filename_for_metadata;
|
||||
use rustc_data_structures::sync::{par_iter, Lrc, Once, ParallelIterator, WorkerLocal};
|
||||
use rustc_data_structures::{box_region_allow_access, declare_box_region_type, parallel};
|
||||
use rustc_errors::PResult;
|
||||
use rustc_expand::base::ExtCtxt;
|
||||
use rustc_incremental;
|
||||
use rustc_mir as mir;
|
||||
use rustc_parse::{parse_crate_from_file, parse_crate_from_source_str};
|
||||
|
@ -39,8 +41,6 @@ use syntax::mut_visit::MutVisitor;
|
|||
use syntax::symbol::Symbol;
|
||||
use syntax::util::node_count::NodeCounter;
|
||||
use syntax::{self, ast, visit};
|
||||
use syntax_expand::base::ExtCtxt;
|
||||
use syntax_ext;
|
||||
use syntax_pos::FileName;
|
||||
|
||||
use rustc_serialize::json;
|
||||
|
@ -164,14 +164,14 @@ pub fn register_plugins<'a>(
|
|||
crate_name: &str,
|
||||
) -> Result<(ast::Crate, Lrc<lint::LintStore>)> {
|
||||
krate = time(sess, "attributes injection", || {
|
||||
syntax_ext::cmdline_attrs::inject(
|
||||
rustc_builtin_macros::cmdline_attrs::inject(
|
||||
krate,
|
||||
&sess.parse_sess,
|
||||
&sess.opts.debugging_opts.crate_attr,
|
||||
)
|
||||
});
|
||||
|
||||
let (krate, features) = syntax_expand::config::features(
|
||||
let (krate, features) = rustc_expand::config::features(
|
||||
krate,
|
||||
&sess.parse_sess,
|
||||
sess.edition(),
|
||||
|
@ -243,11 +243,11 @@ fn configure_and_expand_inner<'a>(
|
|||
});
|
||||
|
||||
let mut resolver = Resolver::new(sess, &krate, crate_name, metadata_loader, &resolver_arenas);
|
||||
syntax_ext::register_builtin_macros(&mut resolver, sess.edition());
|
||||
rustc_builtin_macros::register_builtin_macros(&mut resolver, sess.edition());
|
||||
|
||||
krate = time(sess, "crate injection", || {
|
||||
let alt_std_name = sess.opts.alt_std_name.as_ref().map(|s| Symbol::intern(s));
|
||||
let (krate, name) = syntax_ext::standard_library_imports::inject(
|
||||
let (krate, name) = rustc_builtin_macros::standard_library_imports::inject(
|
||||
krate,
|
||||
&mut resolver,
|
||||
&sess.parse_sess,
|
||||
|
@ -297,12 +297,12 @@ fn configure_and_expand_inner<'a>(
|
|||
|
||||
// Create the config for macro expansion
|
||||
let features = sess.features_untracked();
|
||||
let cfg = syntax_expand::expand::ExpansionConfig {
|
||||
let cfg = rustc_expand::expand::ExpansionConfig {
|
||||
features: Some(&features),
|
||||
recursion_limit: *sess.recursion_limit.get(),
|
||||
trace_mac: sess.opts.debugging_opts.trace_macros,
|
||||
should_test: sess.opts.test,
|
||||
..syntax_expand::expand::ExpansionConfig::default(crate_name.to_string())
|
||||
..rustc_expand::expand::ExpansionConfig::default(crate_name.to_string())
|
||||
};
|
||||
|
||||
let mut ecx = ExtCtxt::new(&sess.parse_sess, cfg, &mut resolver);
|
||||
|
@ -332,7 +332,7 @@ fn configure_and_expand_inner<'a>(
|
|||
});
|
||||
|
||||
time(sess, "maybe building test harness", || {
|
||||
syntax_ext::test_harness::inject(
|
||||
rustc_builtin_macros::test_harness::inject(
|
||||
&sess.parse_sess,
|
||||
&mut resolver,
|
||||
sess.opts.test,
|
||||
|
@ -380,7 +380,7 @@ fn configure_and_expand_inner<'a>(
|
|||
krate = time(sess, "maybe creating a macro crate", || {
|
||||
let num_crate_types = crate_types.len();
|
||||
let is_test_crate = sess.opts.test;
|
||||
syntax_ext::proc_macro_harness::inject(
|
||||
rustc_builtin_macros::proc_macro_harness::inject(
|
||||
&sess.parse_sess,
|
||||
&mut resolver,
|
||||
krate,
|
||||
|
|
|
@ -22,7 +22,7 @@ rustc_index = { path = "../librustc_index" }
|
|||
rustc_serialize = { path = "../libserialize", package = "serialize" }
|
||||
stable_deref_trait = "1.0.0"
|
||||
syntax = { path = "../libsyntax" }
|
||||
syntax_expand = { path = "../librustc_expand", package = "rustc_expand" }
|
||||
rustc_expand = { path = "../librustc_expand" }
|
||||
rustc_parse = { path = "../librustc_parse" }
|
||||
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
|
||||
rustc_error_codes = { path = "../librustc_error_codes" }
|
||||
|
|
|
@ -22,13 +22,13 @@ use std::{cmp, fs};
|
|||
|
||||
use log::{debug, info, log_enabled};
|
||||
use proc_macro::bridge::client::ProcMacro;
|
||||
use rustc_expand::base::SyntaxExtension;
|
||||
use syntax::ast;
|
||||
use syntax::attr;
|
||||
use syntax::edition::Edition;
|
||||
use syntax::expand::allocator::{global_allocator_spans, AllocatorKind};
|
||||
use syntax::span_fatal;
|
||||
use syntax::symbol::{sym, Symbol};
|
||||
use syntax_expand::base::SyntaxExtension;
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
||||
use rustc_error_codes::*;
|
||||
|
|
|
@ -33,12 +33,12 @@ use std::u32;
|
|||
|
||||
use log::debug;
|
||||
use proc_macro::bridge::client::ProcMacro;
|
||||
use rustc_expand::base::{SyntaxExtension, SyntaxExtensionKind};
|
||||
use rustc_expand::proc_macro::{AttrProcMacro, BangProcMacro, ProcMacroDerive};
|
||||
use rustc_serialize::{opaque, Decodable, Decoder, SpecializedDecoder};
|
||||
use syntax::ast::{self, Ident};
|
||||
use syntax::attr;
|
||||
use syntax::source_map::{self, respan, Spanned};
|
||||
use syntax_expand::base::{SyntaxExtension, SyntaxExtensionKind};
|
||||
use syntax_expand::proc_macro::{AttrProcMacro, BangProcMacro, ProcMacroDerive};
|
||||
use syntax_pos::symbol::{sym, Symbol};
|
||||
use syntax_pos::{self, hygiene::MacroKind, BytePos, Pos, Span, DUMMY_SP};
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Process the potential `cfg` attributes on a module.
|
||||
//! Also determine if the module should be included in this configuration.
|
||||
//!
|
||||
//! This module properly belongs in syntax_expand, but for now it's tied into
|
||||
//! This module properly belongs in rustc_expand, but for now it's tied into
|
||||
//! parsing, so we leave it here to avoid complicated out-of-line dependencies.
|
||||
//!
|
||||
//! A principled solution to this wrong location would be to implement [#64197].
|
||||
|
|
|
@ -14,7 +14,7 @@ doctest = false
|
|||
bitflags = "1.2.1"
|
||||
log = "0.4"
|
||||
syntax = { path = "../libsyntax" }
|
||||
syntax_expand = { path = "../librustc_expand", package = "rustc_expand" }
|
||||
rustc_expand = { path = "../librustc_expand" }
|
||||
rustc = { path = "../librustc" }
|
||||
arena = { path = "../libarena" }
|
||||
errors = { path = "../librustc_errors", package = "rustc_errors" }
|
||||
|
|
|
@ -29,6 +29,8 @@ use std::ptr;
|
|||
|
||||
use errors::Applicability;
|
||||
|
||||
use rustc_expand::base::SyntaxExtension;
|
||||
use rustc_expand::expand::AstFragment;
|
||||
use syntax::ast::{self, Block, ForeignItem, ForeignItemKind, Item, ItemKind, NodeId};
|
||||
use syntax::ast::{AssocItem, AssocItemKind, MetaItemKind, StmtKind};
|
||||
use syntax::ast::{Ident, Name};
|
||||
|
@ -38,8 +40,6 @@ use syntax::span_err;
|
|||
use syntax::symbol::{kw, sym};
|
||||
use syntax::token::{self, Token};
|
||||
use syntax::visit::{self, Visitor};
|
||||
use syntax_expand::base::SyntaxExtension;
|
||||
use syntax_expand::expand::AstFragment;
|
||||
use syntax_pos::hygiene::{ExpnId, MacroKind};
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use log::debug;
|
||||
use rustc::hir::def_id::DefIndex;
|
||||
use rustc::hir::map::definitions::*;
|
||||
use rustc_expand::expand::AstFragment;
|
||||
use syntax::ast::*;
|
||||
use syntax::symbol::{kw, sym};
|
||||
use syntax::token::{self, Token};
|
||||
use syntax::visit;
|
||||
use syntax_expand::expand::AstFragment;
|
||||
use syntax_pos::hygiene::ExpnId;
|
||||
use syntax_pos::Span;
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ use rustc::util::nodemap::{DefIdMap, FxHashMap, FxHashSet, NodeMap, NodeSet};
|
|||
use rustc_metadata::creader::{CStore, CrateLoader};
|
||||
|
||||
use errors::{Applicability, DiagnosticBuilder};
|
||||
use rustc_expand::base::SyntaxExtension;
|
||||
use syntax::ast::{self, FloatTy, Ident, IntTy, Name, NodeId, UintTy};
|
||||
use syntax::ast::{Crate, CRATE_NODE_ID};
|
||||
use syntax::ast::{ItemKind, Path};
|
||||
|
@ -45,7 +46,6 @@ use syntax::source_map::Spanned;
|
|||
use syntax::symbol::{kw, sym};
|
||||
use syntax::visit::{self, Visitor};
|
||||
use syntax::{struct_span_err, unwrap_or};
|
||||
use syntax_expand::base::SyntaxExtension;
|
||||
use syntax_pos::hygiene::{ExpnId, ExpnKind, MacroKind, SyntaxContext, Transparency};
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
||||
|
|
|
@ -12,16 +12,16 @@ use rustc::middle::stability;
|
|||
use rustc::session::Session;
|
||||
use rustc::util::nodemap::FxHashSet;
|
||||
use rustc::{lint, span_bug, ty};
|
||||
use rustc_expand::base::SyntaxExtension;
|
||||
use rustc_expand::base::{self, Indeterminate, InvocationRes};
|
||||
use rustc_expand::compile_declarative_macro;
|
||||
use rustc_expand::expand::{AstFragment, AstFragmentKind, Invocation, InvocationKind};
|
||||
use rustc_feature::is_builtin_attr_name;
|
||||
use syntax::ast::{self, Ident, NodeId};
|
||||
use syntax::attr::{self, StabilityLevel};
|
||||
use syntax::edition::Edition;
|
||||
use syntax::feature_gate::feature_err;
|
||||
use syntax::print::pprust;
|
||||
use syntax_expand::base::SyntaxExtension;
|
||||
use syntax_expand::base::{self, Indeterminate, InvocationRes};
|
||||
use syntax_expand::compile_declarative_macro;
|
||||
use syntax_expand::expand::{AstFragment, AstFragmentKind, Invocation, InvocationKind};
|
||||
use syntax_pos::hygiene::{self, ExpnData, ExpnId, ExpnKind};
|
||||
use syntax_pos::symbol::{kw, sym, Symbol};
|
||||
use syntax_pos::{Span, DUMMY_SP};
|
||||
|
|
|
@ -25,7 +25,7 @@ extern crate rustc;
|
|||
extern crate rustc_data_structures;
|
||||
extern crate rustc_driver;
|
||||
extern crate rustc_error_codes;
|
||||
extern crate rustc_expand as syntax_expand;
|
||||
extern crate rustc_expand;
|
||||
extern crate rustc_feature;
|
||||
extern crate rustc_index;
|
||||
extern crate rustc_interface;
|
||||
|
|
|
@ -8,12 +8,12 @@ use rustc::hir::def::{
|
|||
use rustc::hir::def_id::DefId;
|
||||
use rustc::lint;
|
||||
use rustc::ty;
|
||||
use rustc_expand::base::SyntaxExtensionKind;
|
||||
use rustc_feature::UnstableFeatures;
|
||||
use rustc_resolve::ParentScope;
|
||||
use syntax;
|
||||
use syntax::ast::{self, Ident};
|
||||
use syntax::symbol::Symbol;
|
||||
use syntax_expand::base::SyntaxExtensionKind;
|
||||
use syntax_pos::DUMMY_SP;
|
||||
|
||||
use std::ops::Range;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
extern crate syntax;
|
||||
extern crate rustc;
|
||||
extern crate rustc_driver;
|
||||
extern crate syntax_pos;
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::{TokenTree, TokenStream};
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#![feature(rustc_private)]
|
||||
|
||||
extern crate syntax;
|
||||
extern crate syntax_expand;
|
||||
extern crate rustc_parse;
|
||||
|
||||
use rustc_parse::new_parser_from_file;
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
extern crate rustc_data_structures;
|
||||
extern crate syntax;
|
||||
extern crate syntax_expand;
|
||||
extern crate rustc_parse;
|
||||
|
||||
use rustc_data_structures::thin_vec::ThinVec;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue