Skip to content

Commit a2823e3

Browse files
committed
Rename libsyntax_ext and libsyntax_expand in code
1 parent b9a9c5b commit a2823e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+69
-72
lines changed

src/librustc_builtin_macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ rustc_parse = { path = "../librustc_parse" }
1919
rustc_target = { path = "../librustc_target" }
2020
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2121
syntax = { path = "../libsyntax" }
22-
syntax_expand = { path = "../librustc_expand", package = "rustc_expand" }
22+
rustc_expand = { path = "../librustc_expand" }
2323
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
2424
rustc_error_codes = { path = "../librustc_error_codes" }

src/librustc_builtin_macros/asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
use State::*;
44

55
use errors::{DiagnosticBuilder, PResult};
6+
use rustc_expand::base::*;
67
use rustc_parse::parser::Parser;
78
use syntax::ast::{self, AsmDialect};
89
use syntax::ptr::P;
910
use syntax::symbol::{kw, sym, Symbol};
1011
use syntax::token::{self, Token};
1112
use syntax::tokenstream::{self, TokenStream};
1213
use syntax::{span_err, struct_span_err};
13-
use syntax_expand::base::*;
1414
use syntax_pos::Span;
1515

1616
use rustc_error_codes::*;

src/librustc_builtin_macros/assert.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use errors::{Applicability, DiagnosticBuilder};
22

3+
use rustc_expand::base::*;
34
use rustc_parse::parser::Parser;
45
use syntax::ast::{self, *};
56
use syntax::print::pprust;
67
use syntax::ptr::P;
78
use syntax::symbol::{sym, Symbol};
89
use syntax::token::{self, TokenKind};
910
use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree};
10-
use syntax_expand::base::*;
1111
use syntax_pos::{Span, DUMMY_SP};
1212

1313
pub fn expand_assert<'cx>(

src/librustc_builtin_macros/cfg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
/// current compilation environment.
44
use errors::DiagnosticBuilder;
55

6+
use rustc_expand::base::{self, *};
67
use syntax::ast;
78
use syntax::attr;
89
use syntax::token;
910
use syntax::tokenstream::TokenStream;
10-
use syntax_expand::base::{self, *};
1111
use syntax_pos::Span;
1212

1313
pub fn expand_cfg(

src/librustc_builtin_macros/cmdline_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Attributes injected into the crate root from command line using `-Z crate-attr`.
22
3+
use rustc_expand::panictry;
34
use syntax::ast::{self, AttrItem, AttrStyle};
45
use syntax::attr::mk_attr;
56
use syntax::sess::ParseSess;
67
use syntax::token;
7-
use syntax_expand::panictry;
88
use syntax_pos::FileName;
99

1010
pub fn inject(mut krate: ast::Crate, parse_sess: &ParseSess, attrs: &[String]) -> ast::Crate {

src/librustc_builtin_macros/compile_error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The compiler code necessary to support the compile_error! extension.
22

3+
use rustc_expand::base::{self, *};
34
use syntax::tokenstream::TokenStream;
4-
use syntax_expand::base::{self, *};
55
use syntax_pos::Span;
66

77
pub fn expand_compile_error<'cx>(

src/librustc_builtin_macros/concat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use rustc_expand::base::{self, DummyResult};
12
use syntax::ast;
23
use syntax::symbol::Symbol;
34
use syntax::tokenstream::TokenStream;
4-
use syntax_expand::base::{self, DummyResult};
55

66
use std::string::String;
77

src/librustc_builtin_macros/concat_idents.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
use rustc_expand::base::{self, *};
12
use syntax::ast;
23
use syntax::ptr::P;
34
use syntax::token::{self, Token};
45
use syntax::tokenstream::{TokenStream, TokenTree};
5-
use syntax_expand::base::{self, *};
66
use syntax_pos::symbol::Symbol;
77
use syntax_pos::Span;
88

src/librustc_builtin_macros/deriving/bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use crate::deriving::generic::ty::*;
22
use crate::deriving::generic::*;
33
use crate::deriving::path_std;
44

5+
use rustc_expand::base::{Annotatable, ExtCtxt};
56
use syntax::ast::MetaItem;
6-
use syntax_expand::base::{Annotatable, ExtCtxt};
77
use syntax_pos::Span;
88

99
pub fn expand_deriving_copy(

src/librustc_builtin_macros/deriving/clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
22
use crate::deriving::generic::*;
33
use crate::deriving::path_std;
44

5+
use rustc_expand::base::{Annotatable, ExtCtxt};
56
use syntax::ast::{self, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
67
use syntax::ptr::P;
78
use syntax::symbol::{kw, sym, Symbol};
8-
use syntax_expand::base::{Annotatable, ExtCtxt};
99
use syntax_pos::Span;
1010

1111
pub fn expand_deriving_clone(

src/librustc_builtin_macros/deriving/cmp/eq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
22
use crate::deriving::generic::*;
33
use crate::deriving::path_std;
44

5+
use rustc_expand::base::{Annotatable, ExtCtxt};
56
use syntax::ast::{self, Expr, GenericArg, Ident, MetaItem};
67
use syntax::ptr::P;
78
use syntax::symbol::{sym, Symbol};
8-
use syntax_expand::base::{Annotatable, ExtCtxt};
99
use syntax_pos::Span;
1010

1111
pub fn expand_deriving_eq(

src/librustc_builtin_macros/deriving/cmp/ord.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
22
use crate::deriving::generic::*;
33
use crate::deriving::path_std;
44

5+
use rustc_expand::base::{Annotatable, ExtCtxt};
56
use syntax::ast::{self, Expr, MetaItem};
67
use syntax::ptr::P;
78
use syntax::symbol::sym;
8-
use syntax_expand::base::{Annotatable, ExtCtxt};
99
use syntax_pos::Span;
1010

1111
pub fn expand_deriving_ord(

src/librustc_builtin_macros/deriving/cmp/partial_eq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
22
use crate::deriving::generic::*;
33
use crate::deriving::{path_local, path_std};
44

5+
use rustc_expand::base::{Annotatable, ExtCtxt};
56
use syntax::ast::{BinOpKind, Expr, MetaItem};
67
use syntax::ptr::P;
78
use syntax::symbol::sym;
8-
use syntax_expand::base::{Annotatable, ExtCtxt};
99
use syntax_pos::Span;
1010

1111
pub fn expand_deriving_partial_eq(

src/librustc_builtin_macros/deriving/cmp/partial_ord.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use crate::deriving::generic::ty::*;
44
use crate::deriving::generic::*;
55
use crate::deriving::{path_local, path_std, pathvec_std};
66

7+
use rustc_expand::base::{Annotatable, ExtCtxt};
78
use syntax::ast::{self, BinOpKind, Expr, MetaItem};
89
use syntax::ptr::P;
910
use syntax::symbol::{sym, Symbol};
10-
use syntax_expand::base::{Annotatable, ExtCtxt};
1111
use syntax_pos::Span;
1212

1313
pub fn expand_deriving_partial_ord(

src/librustc_builtin_macros/deriving/debug.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use crate::deriving::generic::ty::*;
22
use crate::deriving::generic::*;
33
use crate::deriving::path_std;
44

5+
use rustc_expand::base::{Annotatable, ExtCtxt};
56
use syntax::ast::{self, Ident};
67
use syntax::ast::{Expr, MetaItem};
78
use syntax::ptr::P;
89
use syntax::symbol::sym;
9-
use syntax_expand::base::{Annotatable, ExtCtxt};
1010
use syntax_pos::{Span, DUMMY_SP};
1111

1212
pub fn expand_deriving_debug(

src/librustc_builtin_macros/deriving/decodable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ use crate::deriving::generic::ty::*;
44
use crate::deriving::generic::*;
55
use crate::deriving::pathvec_std;
66

7+
use rustc_expand::base::{Annotatable, ExtCtxt};
78
use syntax::ast;
89
use syntax::ast::{Expr, MetaItem, Mutability};
910
use syntax::ptr::P;
1011
use syntax::symbol::Symbol;
11-
use syntax_expand::base::{Annotatable, ExtCtxt};
1212
use syntax_pos::Span;
1313

1414
pub fn expand_deriving_rustc_decodable(

src/librustc_builtin_macros/deriving/default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use crate::deriving::generic::ty::*;
22
use crate::deriving::generic::*;
33
use crate::deriving::path_std;
44

5+
use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt};
56
use syntax::ast::{Expr, MetaItem};
67
use syntax::ptr::P;
78
use syntax::span_err;
89
use syntax::symbol::{kw, sym};
9-
use syntax_expand::base::{Annotatable, DummyResult, ExtCtxt};
1010
use syntax_pos::Span;
1111

1212
use rustc_error_codes::*;

src/librustc_builtin_macros/deriving/encodable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ use crate::deriving::generic::ty::*;
8989
use crate::deriving::generic::*;
9090
use crate::deriving::pathvec_std;
9191

92+
use rustc_expand::base::{Annotatable, ExtCtxt};
9293
use syntax::ast::{Expr, ExprKind, MetaItem, Mutability};
9394
use syntax::ptr::P;
9495
use syntax::symbol::Symbol;
95-
use syntax_expand::base::{Annotatable, ExtCtxt};
9696
use syntax_pos::Span;
9797

9898
pub fn expand_deriving_rustc_encodable(

src/librustc_builtin_macros/deriving/generic/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ use std::cell::RefCell;
181181
use std::iter;
182182
use std::vec;
183183

184+
use rustc_expand::base::{Annotatable, ExtCtxt};
184185
use syntax::ast::{self, BinOpKind, EnumDef, Expr, Generics, Ident, PatKind};
185186
use syntax::ast::{GenericArg, GenericParamKind, VariantData};
186187
use syntax::attr;
@@ -189,7 +190,6 @@ use syntax::sess::ParseSess;
189190
use syntax::source_map::respan;
190191
use syntax::symbol::{kw, sym, Symbol};
191192
use syntax::util::map_in_place::MapInPlace;
192-
use syntax_expand::base::{Annotatable, ExtCtxt};
193193
use syntax_pos::Span;
194194

195195
use ty::{LifetimeBounds, Path, Ptr, PtrTy, Self_, Ty};

src/librustc_builtin_macros/deriving/generic/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
pub use PtrTy::*;
55
pub use Ty::*;
66

7+
use rustc_expand::base::ExtCtxt;
78
use syntax::ast::{self, Expr, GenericArg, GenericParamKind, Generics, Ident, SelfKind};
89
use syntax::ptr::P;
910
use syntax::source_map::{respan, DUMMY_SP};
10-
use syntax_expand::base::ExtCtxt;
1111
use syntax_pos::symbol::kw;
1212
use syntax_pos::Span;
1313

src/librustc_builtin_macros/deriving/hash.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use crate::deriving::generic::ty::*;
22
use crate::deriving::generic::*;
33
use crate::deriving::{self, path_std, pathvec_std};
44

5+
use rustc_expand::base::{Annotatable, ExtCtxt};
56
use syntax::ast::{Expr, MetaItem, Mutability};
67
use syntax::ptr::P;
78
use syntax::symbol::sym;
8-
use syntax_expand::base::{Annotatable, ExtCtxt};
99
use syntax_pos::Span;
1010

1111
pub fn expand_deriving_hash(

src/librustc_builtin_macros/deriving/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! The compiler code necessary to implement the `#[derive]` extensions.
22
3+
use rustc_expand::base::{Annotatable, ExtCtxt, MultiItemModifier};
34
use syntax::ast::{self, ItemKind, MetaItem};
45
use syntax::ptr::P;
56
use syntax::symbol::{sym, Symbol};
6-
use syntax_expand::base::{Annotatable, ExtCtxt, MultiItemModifier};
77
use syntax_pos::Span;
88

99
macro path_local($x:ident) {

src/librustc_builtin_macros/env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// interface.
44
//
55

6+
use rustc_expand::base::{self, *};
67
use syntax::ast::{self, GenericArg, Ident};
78
use syntax::symbol::{kw, sym, Symbol};
89
use syntax::tokenstream::TokenStream;
9-
use syntax_expand::base::{self, *};
1010
use syntax_pos::Span;
1111

1212
use std::env;

src/librustc_builtin_macros/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ use errors::pluralize;
77
use errors::Applicability;
88
use errors::DiagnosticBuilder;
99

10+
use rustc_expand::base::{self, *};
1011
use syntax::ast;
1112
use syntax::ptr::P;
1213
use syntax::symbol::{sym, Symbol};
1314
use syntax::token;
1415
use syntax::tokenstream::TokenStream;
15-
use syntax_expand::base::{self, *};
1616
use syntax_pos::{MultiSpan, Span};
1717

1818
use rustc_data_structures::fx::{FxHashMap, FxHashSet};

src/librustc_builtin_macros/global_allocator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::util::check_builtin_macro_attribute;
22

3+
use rustc_expand::base::{Annotatable, ExtCtxt};
34
use syntax::ast::{self, Attribute, Expr, FnHeader, FnSig, Generics, Ident, Param};
45
use syntax::ast::{ItemKind, Mutability, Stmt, Ty, TyKind, Unsafety};
56
use syntax::expand::allocator::{AllocatorKind, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};
67
use syntax::ptr::P;
78
use syntax::symbol::{kw, sym, Symbol};
8-
use syntax_expand::base::{Annotatable, ExtCtxt};
99
use syntax_pos::Span;
1010

1111
pub fn expand(

src/librustc_builtin_macros/global_asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
/// therefore apply.
1010
use errors::DiagnosticBuilder;
1111

12+
use rustc_expand::base::{self, *};
1213
use smallvec::smallvec;
1314
use syntax::ast;
1415
use syntax::ptr::P;
1516
use syntax::source_map::respan;
1617
use syntax::token;
1718
use syntax::tokenstream::TokenStream;
18-
use syntax_expand::base::{self, *};
1919
use syntax_pos::Span;
2020

2121
pub fn expand_global_asm<'cx>(

src/librustc_builtin_macros/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ extern crate proc_macro;
1313

1414
use crate::deriving::*;
1515

16+
use rustc_expand::base::{MacroExpanderFn, Resolver, SyntaxExtension, SyntaxExtensionKind};
17+
use rustc_expand::proc_macro::BangProcMacro;
1618
use syntax::ast::Ident;
1719
use syntax::edition::Edition;
1820
use syntax::symbol::sym;
19-
use syntax_expand::base::{MacroExpanderFn, Resolver, SyntaxExtension, SyntaxExtensionKind};
20-
use syntax_expand::proc_macro::BangProcMacro;
2121

2222
mod asm;
2323
mod assert;

src/librustc_builtin_macros/log_syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use rustc_expand::base;
12
use syntax::print;
23
use syntax::tokenstream::TokenStream;
3-
use syntax_expand::base;
44
use syntax_pos;
55

66
pub fn expand_log_syntax<'cx>(

src/librustc_builtin_macros/proc_macro_harness.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use std::mem;
22

3+
use rustc_expand::base::{ExtCtxt, Resolver};
4+
use rustc_expand::expand::{AstFragment, ExpansionConfig};
35
use smallvec::smallvec;
46
use syntax::ast::{self, Ident};
57
use syntax::attr;
@@ -9,8 +11,6 @@ use syntax::ptr::P;
911
use syntax::sess::ParseSess;
1012
use syntax::symbol::{kw, sym};
1113
use syntax::visit::{self, Visitor};
12-
use syntax_expand::base::{ExtCtxt, Resolver};
13-
use syntax_expand::expand::{AstFragment, ExpansionConfig};
1414
use syntax_pos::hygiene::AstPass;
1515
use syntax_pos::{Span, DUMMY_SP};
1616

src/librustc_builtin_macros/source_util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use rustc_expand::base::{self, *};
2+
use rustc_expand::panictry;
13
use rustc_parse::{self, new_sub_parser_from_file, parser::Parser, DirectoryOwnership};
24
use syntax::ast;
35
use syntax::early_buffered_lints::INCOMPLETE_INCLUDE;
@@ -6,8 +8,6 @@ use syntax::ptr::P;
68
use syntax::symbol::Symbol;
79
use syntax::token;
810
use syntax::tokenstream::TokenStream;
9-
use syntax_expand::base::{self, *};
10-
use syntax_expand::panictry;
1111

1212
use smallvec::SmallVec;
1313
use syntax_pos::{self, Pos, Span};

src/librustc_builtin_macros/standard_library_imports.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
use rustc_expand::base::{ExtCtxt, Resolver};
2+
use rustc_expand::expand::ExpansionConfig;
13
use syntax::edition::Edition;
24
use syntax::ptr::P;
35
use syntax::sess::ParseSess;
46
use syntax::symbol::{kw, sym, Ident, Symbol};
57
use syntax::{ast, attr};
6-
use syntax_expand::base::{ExtCtxt, Resolver};
7-
use syntax_expand::expand::ExpansionConfig;
88
use syntax_pos::hygiene::AstPass;
99
use syntax_pos::DUMMY_SP;
1010

src/librustc_builtin_macros/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
/// Ideally, this code would be in libtest but for efficiency and error messages it lives here.
33
use crate::util::check_builtin_macro_attribute;
44

5+
use rustc_expand::base::*;
56
use syntax::ast;
67
use syntax::attr;
78
use syntax::print::pprust;
89
use syntax::source_map::respan;
910
use syntax::symbol::{sym, Symbol};
10-
use syntax_expand::base::*;
1111
use syntax_pos::Span;
1212

1313
use std::iter;

0 commit comments

Comments
 (0)