Skip to content

Commit 2917d99

Browse files
committed
Auto merge of #69592 - petrochenkov:nosyntax, r=Centril
Rename `libsyntax` to `librustc_ast` This was the last rustc crate that wasn't following the `rustc_*` naming convention. Follow-up to #67763.
2 parents d3c7934 + e08c279 commit 2917d99

File tree

327 files changed

+722
-709
lines changed

Some content is hidden

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

327 files changed

+722
-709
lines changed

Cargo.lock

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

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ impl Step for Src {
996996
"src/tools/rustc-std-workspace-alloc",
997997
"src/tools/rustc-std-workspace-std",
998998
"src/librustc",
999-
"src/libsyntax",
999+
"src/librustc_ast",
10001000
];
10011001

10021002
copy_src_dirs(builder, &std_src_dirs[..], &[], &dst_src);

src/doc/rustc-ux-guidelines.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ for details on how to format and write long error codes.
6262
* All of them are accessible [online](http://doc.rust-lang.org/error-index.html),
6363
which are auto-generated from rustc source code in different places:
6464
[librustc](https://github.com/rust-lang/rust/blob/master/src/librustc/error_codes.rs),
65-
[libsyntax](https://github.com/rust-lang/rust/blob/master/src/libsyntax/error_codes.rs),
65+
[librustc_ast](https://github.com/rust-lang/rust/blob/master/src/librustc_ast/error_codes.rs),
6666
[librustc_borrowck](https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/error_codes.rs),
6767
[librustc_metadata](https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/error_codes.rs),
6868
[librustc_mir](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/error_codes.rs),

src/doc/unstable-book/src/language-features/plugin.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mechanics of defining and loading a plugin.
2323

2424
In the vast majority of cases, a plugin should *only* be used through
2525
`#![plugin]` and not through an `extern crate` item. Linking a plugin would
26-
pull in all of libsyntax and librustc as dependencies of your crate. This is
26+
pull in all of librustc_ast and librustc as dependencies of your crate. This is
2727
generally unwanted unless you are building another plugin.
2828

2929
The usual practice is to put compiler plugins in their own crate, separate from
@@ -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

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 = "../libsyntax" }
31+
rustc_ast = { path = "../librustc_ast" }
3232
rustc_span = { path = "../librustc_span" }
3333
backtrace = "0.3.40"
3434
parking_lot = "0.9"

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,

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

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

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).

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

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;

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;

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;

src/librustc/ich/impls_syntax.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! This module contains `HashStable` implementations for various data types
2-
//! from libsyntax in no particular order.
2+
//! from librustc_ast in no particular order.
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)));

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;

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

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

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`.

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

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::*;

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;

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

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)]

src/librustc/ty/context.rs

+4-4
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;
@@ -1720,7 +1720,7 @@ pub mod tls {
17201720
set_tlv(context as *const _ as usize, || f(&context))
17211721
}
17221722

1723-
/// Enters `GlobalCtxt` by setting up libsyntax callbacks and
1723+
/// Enters `GlobalCtxt` by setting up librustc_ast callbacks and
17241724
/// creating a initial `TyCtxt` and `ImplicitCtxt`.
17251725
/// This happens once per rustc session and `TyCtxt`s only exists
17261726
/// inside the `f` function.

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;

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

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;

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};

0 commit comments

Comments
 (0)