Skip to content

Commit e08c279

Browse files
committed
Rename syntax to rustc_ast in source code
1 parent 6054a30 commit e08c279

File tree

291 files changed

+650
-637
lines changed

Some content is hidden

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

291 files changed

+650
-637
lines changed

Diff for: src/doc/unstable-book/src/language-features/plugin.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ that warns about any item named `lintme`.
4242
#![feature(plugin_registrar)]
4343
#![feature(box_syntax, rustc_private)]
4444
45-
extern crate syntax;
45+
extern crate rustc_ast;
4646
4747
// Load rustc as a plugin to get macros
4848
#[macro_use]
@@ -52,7 +52,7 @@ extern crate rustc_driver;
5252
use rustc::lint::{EarlyContext, LintContext, LintPass, EarlyLintPass,
5353
EarlyLintPassObject, LintArray};
5454
use rustc_driver::plugin::Registry;
55-
use syntax::ast;
55+
use rustc_ast::ast;
5656
5757
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
5858

Diff for: src/librustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ rustc_data_structures = { path = "../librustc_data_structures" }
2828
rustc_errors = { path = "../librustc_errors" }
2929
rustc_index = { path = "../librustc_index" }
3030
rustc_serialize = { path = "../libserialize", package = "serialize" }
31-
syntax = { path = "../librustc_ast", package = "rustc_ast" }
31+
rustc_ast = { path = "../librustc_ast" }
3232
rustc_span = { path = "../librustc_span" }
3333
backtrace = "0.3.40"
3434
parking_lot = "0.9"

Diff for: src/librustc/arena.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ macro_rules! arena_types {
131131
// HIR types
132132
[few] hir_krate: rustc_hir::Crate<$tcx>,
133133
[] arm: rustc_hir::Arm<$tcx>,
134-
[] attribute: syntax::ast::Attribute,
134+
[] attribute: rustc_ast::ast::Attribute,
135135
[] block: rustc_hir::Block<$tcx>,
136136
[] bare_fn_ty: rustc_hir::BareFnTy<$tcx>,
137137
[few] global_asm: rustc_hir::GlobalAsm,

Diff for: src/librustc/dep_graph/safe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
33
use crate::ty::TyCtxt;
44

5+
use rustc_ast::ast::NodeId;
56
use rustc_hir::def_id::DefId;
67
use rustc_hir::BodyId;
7-
use syntax::ast::NodeId;
88

99
/// The `DepGraphSafe` trait is used to specify what kinds of values
1010
/// are safe to "leak" into a task. The idea is that this should be

Diff for: src/librustc/hir/exports.rs

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

3+
use rustc_ast::ast;
34
use rustc_hir::def::Res;
45
use rustc_hir::def_id::DefIdMap;
56
use rustc_macros::HashStable;
67
use rustc_span::Span;
7-
use syntax::ast;
88

99
use std::fmt::Debug;
1010

Diff for: src/librustc/hir/map/blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
//! for the `Code` associated with a particular NodeId.
1313
1414
use crate::hir::map::Map;
15+
use rustc_ast::ast::{Attribute, Ident};
1516
use rustc_hir as hir;
1617
use rustc_hir::intravisit::FnKind;
1718
use rustc_hir::{Expr, FnDecl, Node};
1819
use rustc_span::Span;
19-
use syntax::ast::{Attribute, Ident};
2020

2121
/// An FnLikeNode is a Node that is like a fn, in that it has a decl
2222
/// and a body (as well as a NodeId, a span, etc).

Diff for: src/librustc/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::hir::map::definitions::{self, DefPathHash};
33
use crate::hir::map::{Entry, HirEntryMap, Map};
44
use crate::ich::StableHashingContext;
55
use crate::middle::cstore::CrateStore;
6+
use rustc_ast::ast::NodeId;
67
use rustc_data_structures::fingerprint::Fingerprint;
78
use rustc_data_structures::fx::FxHashMap;
89
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
@@ -16,7 +17,6 @@ use rustc_index::vec::IndexVec;
1617
use rustc_session::{CrateDisambiguator, Session};
1718
use rustc_span::source_map::SourceMap;
1819
use rustc_span::{Span, Symbol, DUMMY_SP};
19-
use syntax::ast::NodeId;
2020

2121
use std::iter::repeat;
2222

Diff for: src/librustc/hir/map/definitions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
//! There are also some rather random cases (like const initializer
55
//! expressions) that are mostly just leftovers.
66
7+
use rustc_ast::ast;
8+
use rustc_ast::node_id::NodeMap;
79
use rustc_data_structures::fingerprint::Fingerprint;
810
use rustc_data_structures::fx::FxHashMap;
911
use rustc_data_structures::stable_hasher::StableHasher;
@@ -14,8 +16,6 @@ use rustc_session::CrateDisambiguator;
1416
use rustc_span::hygiene::ExpnId;
1517
use rustc_span::symbol::{sym, Symbol};
1618
use rustc_span::Span;
17-
use syntax::ast;
18-
use syntax::node_id::NodeMap;
1919

2020
use std::borrow::Borrow;
2121
use std::fmt::Write;

Diff for: src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub use self::definitions::{
66
use crate::dep_graph::{DepGraph, DepKind, DepNode, DepNodeIndex};
77
use crate::middle::cstore::CrateStoreDyn;
88
use crate::ty::query::Providers;
9+
use rustc_ast::ast::{self, Name, NodeId};
910
use rustc_data_structures::fx::FxHashMap;
1011
use rustc_data_structures::svh::Svh;
1112
use rustc_hir::def::{DefKind, Res};
@@ -20,7 +21,6 @@ use rustc_span::source_map::Spanned;
2021
use rustc_span::symbol::kw;
2122
use rustc_span::Span;
2223
use rustc_target::spec::abi::Abi;
23-
use syntax::ast::{self, Name, NodeId};
2424

2525
pub mod blocks;
2626
mod collector;

Diff for: src/librustc/ich/hcx.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::middle::cstore::CrateStore;
55
use crate::session::Session;
66
use crate::ty::{fast_reject, TyCtxt};
77

8+
use rustc_ast::ast;
89
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
910
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
1011
use rustc_data_structures::sync::Lrc;
@@ -13,7 +14,6 @@ use rustc_hir::def_id::{DefId, DefIndex};
1314
use rustc_span::source_map::SourceMap;
1415
use rustc_span::symbol::Symbol;
1516
use rustc_span::{BytePos, SourceFile};
16-
use syntax::ast;
1717

1818
use smallvec::SmallVec;
1919
use std::cmp::Ord;

Diff for: src/librustc/ich/impls_syntax.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
44
use crate::ich::StableHashingContext;
55

6+
use rustc_ast::ast;
67
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
78
use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX};
89
use rustc_span::SourceFile;
9-
use syntax::ast;
1010

1111
use smallvec::SmallVec;
1212

@@ -35,7 +35,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for [ast::Attribute] {
3535
}
3636
}
3737

38-
impl<'ctx> syntax::HashStableContext for StableHashingContext<'ctx> {
38+
impl<'ctx> rustc_ast::HashStableContext for StableHashingContext<'ctx> {
3939
fn hash_attr(&mut self, attr: &ast::Attribute, hasher: &mut StableHasher) {
4040
// Make sure that these have been filtered out.
4141
debug_assert!(!attr.ident().map_or(false, |ident| self.is_ignored_attr(ident.name)));

Diff for: src/librustc/middle/cstore.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use crate::session::search_paths::PathKind;
88
use crate::session::CrateDisambiguator;
99
use crate::ty::TyCtxt;
1010

11+
use rustc_ast::ast;
12+
use rustc_ast::expand::allocator::AllocatorKind;
1113
use rustc_data_structures::svh::Svh;
1214
use rustc_data_structures::sync::{self, MetadataRef};
1315
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
@@ -17,8 +19,6 @@ use rustc_span::Span;
1719
use rustc_target::spec::Target;
1820
use std::any::Any;
1921
use std::path::{Path, PathBuf};
20-
use syntax::ast;
21-
use syntax::expand::allocator::AllocatorKind;
2222

2323
pub use self::NativeLibraryKind::*;
2424
pub use rustc_session::utils::NativeLibraryKind;

Diff for: src/librustc/middle/recursion_limit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use crate::session::Session;
99
use core::num::IntErrorKind;
1010
use rustc::bug;
11+
use rustc_ast::ast;
1112
use rustc_span::symbol::{sym, Symbol};
12-
use syntax::ast;
1313

1414
use rustc_data_structures::sync::Once;
1515

Diff for: src/librustc/middle/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub use self::StabilityLevel::*;
55

66
use crate::session::{DiagnosticMessageId, Session};
77
use crate::ty::{self, TyCtxt};
8+
use rustc_ast::ast::CRATE_NODE_ID;
89
use rustc_attr::{self as attr, ConstStability, Deprecation, RustcDeprecation, Stability};
910
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1011
use rustc_errors::{Applicability, DiagnosticBuilder};
@@ -18,7 +19,6 @@ use rustc_session::lint::{BuiltinLintDiagnostics, Lint, LintBuffer};
1819
use rustc_session::parse::feature_err_issue;
1920
use rustc_span::symbol::{sym, Symbol};
2021
use rustc_span::{MultiSpan, Span};
21-
use syntax::ast::CRATE_NODE_ID;
2222

2323
use std::num::NonZeroU32;
2424

Diff for: src/librustc/mir/interpret/allocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ use super::{
66

77
use crate::ty::layout::{Align, Size};
88

9+
use rustc_ast::ast::Mutability;
910
use rustc_data_structures::sorted_map::SortedMap;
1011
use rustc_target::abi::HasDataLayout;
1112
use std::borrow::Cow;
1213
use std::iter;
1314
use std::ops::{Deref, DerefMut, Range};
14-
use syntax::ast::Mutability;
1515

1616
// NOTE: When adding new fields, make sure to adjust the `Snapshot` impl in
1717
// `src/librustc_mir/interpret/snapshot.rs`.

Diff for: src/librustc/mir/interpret/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ use crate::ty::layout::{self, Size};
107107
use crate::ty::subst::GenericArgKind;
108108
use crate::ty::{self, Instance, Ty, TyCtxt};
109109
use byteorder::{BigEndian, LittleEndian, ReadBytesExt, WriteBytesExt};
110+
use rustc_ast::ast::LitKind;
110111
use rustc_data_structures::fx::FxHashMap;
111112
use rustc_data_structures::sync::{HashMapExt, Lock};
112113
use rustc_data_structures::tiny_list::TinyList;
@@ -117,7 +118,6 @@ use std::fmt;
117118
use std::io;
118119
use std::num::NonZeroU32;
119120
use std::sync::atomic::{AtomicU32, Ordering};
120-
use syntax::ast::LitKind;
121121

122122
/// Uniquely identifies one of the following:
123123
/// - A constant

Diff for: src/librustc/mir/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ use rustc_hir::def_id::DefId;
1818
use rustc_hir::{self, GeneratorKind};
1919

2020
use polonius_engine::Atom;
21+
pub use rustc_ast::ast::Mutability;
22+
use rustc_ast::ast::Name;
2123
use rustc_data_structures::fx::FxHashSet;
2224
use rustc_data_structures::graph::dominators::Dominators;
2325
use rustc_data_structures::graph::{self, GraphSuccessors};
@@ -32,8 +34,6 @@ use std::fmt::{self, Debug, Display, Formatter, Write};
3234
use std::ops::Index;
3335
use std::slice;
3436
use std::{iter, mem, option, u32};
35-
pub use syntax::ast::Mutability;
36-
use syntax::ast::Name;
3737

3838
pub use self::cache::{BodyAndCache, ReadOnlyBodyAndCache};
3939
pub use self::query::*;

Diff for: src/librustc/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use crate::ty::fold::{TypeFolder, TypeVisitor};
1313
use crate::ty::subst::SubstsRef;
1414
use crate::ty::{self, AdtKind, List, Ty, TyCtxt};
1515

16+
use rustc_ast::ast;
1617
use rustc_hir as hir;
1718
use rustc_hir::def_id::DefId;
1819
use rustc_span::{Span, DUMMY_SP};
1920
use smallvec::SmallVec;
20-
use syntax::ast;
2121

2222
use std::borrow::Cow;
2323
use std::fmt::Debug;

Diff for: src/librustc/traits/specialization_graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::ich::{self, StableHashingContext};
22
use crate::ty::fast_reject::SimplifiedType;
33
use crate::ty::{self, TyCtxt};
4+
use rustc_ast::ast::Ident;
45
use rustc_data_structures::fx::FxHashMap;
56
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
67
use rustc_hir::def_id::{DefId, DefIdMap};
7-
use syntax::ast::Ident;
88

99
/// A per-trait graph of impls in specialization order. At the moment, this
1010
/// graph forms a tree rooted with the trait itself, with all other nodes

Diff for: src/librustc/ty/cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
use crate::ty::{self, Ty};
55

6+
use rustc_ast::ast;
67
use rustc_macros::HashStable;
7-
use syntax::ast;
88

99
/// Types that are represented as ints.
1010
#[derive(Copy, Clone, Debug, PartialEq, Eq)]

Diff for: src/librustc/ty/context.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ use crate::ty::{InferConst, ParamConst};
4242
use crate::ty::{List, TyKind, TyS};
4343
use crate::util::common::ErrorReported;
4444
use rustc::lint::LintDiagnosticBuilder;
45+
use rustc_ast::ast;
46+
use rustc_ast::expand::allocator::AllocatorKind;
47+
use rustc_ast::node_id::NodeMap;
4548
use rustc_attr as attr;
4649
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
4750
use rustc_data_structures::profiling::SelfProfilerRef;
@@ -65,9 +68,6 @@ use rustc_span::source_map::MultiSpan;
6568
use rustc_span::symbol::{kw, sym, Symbol};
6669
use rustc_span::Span;
6770
use rustc_target::spec::abi;
68-
use syntax::ast;
69-
use syntax::expand::allocator::AllocatorKind;
70-
use syntax::node_id::NodeMap;
7171

7272
use smallvec::SmallVec;
7373
use std::any::Any;

Diff for: src/librustc/ty/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::ty::{self, BoundRegion, Region, Ty, TyCtxt};
2+
use rustc_ast::ast;
23
use rustc_errors::{pluralize, Applicability, DiagnosticBuilder};
34
use rustc_hir as hir;
45
use rustc_hir::def_id::DefId;
56
use rustc_span::Span;
67
use rustc_target::spec::abi;
7-
use syntax::ast;
88

99
use std::borrow::Cow;
1010
use std::fmt;

Diff for: src/librustc/ty/fast_reject.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::ich::StableHashingContext;
22
use crate::ty::{self, Ty, TyCtxt};
3+
use rustc_ast::ast;
34
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
45
use rustc_hir::def_id::DefId;
56
use std::fmt::Debug;
67
use std::hash::Hash;
78
use std::mem;
8-
use syntax::ast;
99

1010
use self::SimplifiedTypeGen::*;
1111

Diff for: src/librustc/ty/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::session::{self, DataTypeKind};
22
use crate::ty::{self, subst::SubstsRef, ReprOptions, Ty, TyCtxt, TypeFoldable};
33

4+
use rustc_ast::ast::{self, Ident, IntTy, UintTy};
45
use rustc_attr as attr;
56
use rustc_span::DUMMY_SP;
6-
use syntax::ast::{self, Ident, IntTy, UintTy};
77

88
use std::cmp;
99
use std::fmt;

Diff for: src/librustc/ty/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ use crate::ty::layout::VariantIdx;
2626
use crate::ty::subst::{InternalSubsts, Subst, SubstsRef};
2727
use crate::ty::util::{Discr, IntTypeExt};
2828
use crate::ty::walk::TypeWalker;
29+
use rustc_ast::ast::{self, Ident, Name};
30+
use rustc_ast::node_id::{NodeId, NodeMap, NodeSet};
2931
use rustc_attr as attr;
3032
use rustc_data_structures::captures::Captures;
3133
use rustc_data_structures::fx::FxHashMap;
@@ -44,8 +46,6 @@ use rustc_span::hygiene::ExpnId;
4446
use rustc_span::symbol::{kw, sym, Symbol};
4547
use rustc_span::Span;
4648
use rustc_target::abi::Align;
47-
use syntax::ast::{self, Ident, Name};
48-
use syntax::node_id::{NodeId, NodeMap, NodeSet};
4949

5050
use std::cell::RefCell;
5151
use std::cmp::{self, Ordering};

Diff for: src/librustc/ty/print/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
1111

1212
use rustc_apfloat::ieee::{Double, Single};
1313
use rustc_apfloat::Float;
14+
use rustc_ast::ast;
1415
use rustc_attr::{SignedInt, UnsignedInt};
1516
use rustc_span::symbol::{kw, Symbol};
1617
use rustc_target::spec::abi::Abi;
17-
use syntax::ast;
1818

1919
use std::cell::Cell;
2020
use std::collections::BTreeMap;

Diff for: src/librustc/ty/query/job.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,11 @@ pub unsafe fn handle_deadlock() {
535535
let rustc_span_globals =
536536
rustc_span::GLOBALS.with(|rustc_span_globals| rustc_span_globals as *const _);
537537
let rustc_span_globals = &*rustc_span_globals;
538-
let syntax_globals = syntax::attr::GLOBALS.with(|syntax_globals| syntax_globals as *const _);
538+
let syntax_globals = rustc_ast::attr::GLOBALS.with(|syntax_globals| syntax_globals as *const _);
539539
let syntax_globals = &*syntax_globals;
540540
thread::spawn(move || {
541541
tls::GCX_PTR.set(gcx_ptr, || {
542-
syntax::attr::GLOBALS.set(syntax_globals, || {
542+
rustc_ast::attr::GLOBALS.set(syntax_globals, || {
543543
rustc_span::GLOBALS
544544
.set(rustc_span_globals, || tls::with_global(|tcx| deadlock(tcx, &registry)))
545545
});

0 commit comments

Comments
 (0)