Skip to content

Commit a9dd56f

Browse files
committed
Auto merge of #67707 - petrochenkov:crateren, r=Centril
Rename some crates and modules in the frontend Migrate from `syntax_*` naming scheme to `rustc_*`. See #65324 (comment) and several comments below. Renamed crates: `syntax_expand` -> `rustc_expand` `syntax_pos` -> `rustc_span` ([motivation](#65324 (comment))) `syntax_ext` -> `rustc_builtin_macros` Also one module in resolve is renamed for consistency and to avoid tautology. r? @Centril
2 parents 9d6f871 + 7608f21 commit a9dd56f

File tree

113 files changed

+195
-198
lines changed

Some content is hidden

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

113 files changed

+195
-198
lines changed

Diff for: Cargo.lock

+78-78
Large diffs are not rendered by default.

Diff for: src/libfmt_macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ name = "fmt_macros"
99
path = "lib.rs"
1010

1111
[dependencies]
12-
syntax_pos = { path = "../libsyntax_pos" }
12+
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
1313
rustc_lexer = { path = "../librustc_lexer" }

Diff for: src/librustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rustc_index = { path = "../librustc_index" }
3030
errors = { path = "../librustc_errors", package = "rustc_errors" }
3131
rustc_serialize = { path = "../libserialize", package = "serialize" }
3232
syntax = { path = "../libsyntax" }
33-
syntax_pos = { path = "../libsyntax_pos" }
33+
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
3434
backtrace = "0.3.40"
3535
parking_lot = "0.9"
3636
byteorder = { version = "1.3" }

Diff for: src/libsyntax_ext/Cargo.toml renamed to src/librustc_builtin_macros/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
authors = ["The Rust Project Developers"]
3-
name = "syntax_ext"
3+
name = "rustc_builtin_macros"
44
version = "0.0.0"
55
edition = "2018"
66

77
[lib]
8-
name = "syntax_ext"
8+
name = "rustc_builtin_macros"
99
path = "lib.rs"
1010
doctest = false
1111

@@ -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 = "../libsyntax_expand" }
23-
syntax_pos = { path = "../libsyntax_pos" }
22+
rustc_expand = { path = "../librustc_expand" }
23+
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
2424
rustc_error_codes = { path = "../librustc_error_codes" }

Diff for: src/libsyntax_ext/asm.rs renamed to 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::*;

Diff for: src/libsyntax_ext/assert.rs renamed to 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>(

Diff for: src/libsyntax_ext/cfg.rs renamed to 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(

Diff for: src/libsyntax_ext/cmdline_attrs.rs renamed to 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 {

Diff for: src/libsyntax_ext/compile_error.rs renamed to 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>(

Diff for: src/libsyntax_ext/concat.rs renamed to 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

Diff for: src/libsyntax_ext/concat_idents.rs renamed to 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

Diff for: src/libsyntax_ext/deriving/bounds.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/clone.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/cmp/eq.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/cmp/ord.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/cmp/partial_eq.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/cmp/partial_ord.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/debug.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/decodable.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/default.rs renamed to 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::*;

Diff for: src/libsyntax_ext/deriving/encodable.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/generic/mod.rs renamed to src/librustc_builtin_macros/deriving/generic/mod.rs

+5-5
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};
@@ -412,8 +412,8 @@ impl<'a> TraitDef<'a> {
412412
_ => {
413413
// Non-ADT derive is an error, but it should have been
414414
// set earlier; see
415-
// libsyntax_expand/expand.rs:MacroExpander::fully_expand_fragment()
416-
// libsyntax_expand/base.rs:Annotatable::derive_allowed()
415+
// librustc_expand/expand.rs:MacroExpander::fully_expand_fragment()
416+
// librustc_expand/base.rs:Annotatable::derive_allowed()
417417
return;
418418
}
419419
};
@@ -487,8 +487,8 @@ impl<'a> TraitDef<'a> {
487487
_ => {
488488
// Non-Item derive is an error, but it should have been
489489
// set earlier; see
490-
// libsyntax_expand/expand.rs:MacroExpander::fully_expand_fragment()
491-
// libsyntax_expand/base.rs:Annotatable::derive_allowed()
490+
// librustc_expand/expand.rs:MacroExpander::fully_expand_fragment()
491+
// librustc_expand/base.rs:Annotatable::derive_allowed()
492492
return;
493493
}
494494
}

Diff for: src/libsyntax_ext/deriving/generic/ty.rs renamed to 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

Diff for: src/libsyntax_ext/deriving/hash.rs renamed to 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(

Diff for: src/libsyntax_ext/deriving/mod.rs renamed to src/librustc_builtin_macros/deriving/mod.rs

+3-3
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) {
@@ -92,8 +92,8 @@ fn inject_impl_of_structural_trait(
9292
_ => {
9393
// Non-Item derive is an error, but it should have been
9494
// set earlier; see
95-
// libsyntax_expand/expand.rs:MacroExpander::fully_expand_fragment()
96-
// libsyntax_expand/base.rs:Annotatable::derive_allowed()
95+
// librustc_expand/expand.rs:MacroExpander::fully_expand_fragment()
96+
// librustc_expand/base.rs:Annotatable::derive_allowed()
9797
return;
9898
}
9999
};

Diff for: src/libsyntax_ext/env.rs renamed to 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;

Diff for: src/libsyntax_ext/format.rs renamed to 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};
File renamed without changes.

Diff for: src/libsyntax_ext/global_allocator.rs renamed to 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(

Diff for: src/libsyntax_ext/global_asm.rs renamed to 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>(

Diff for: src/libsyntax_ext/lib.rs renamed to 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;

0 commit comments

Comments
 (0)