Skip to content

Commit 6ee5111

Browse files
committed
Move node_id module from rustc_ast to rustc_span.
This puts it alongside `rustc_span::def_id`, which serves a similar purpose. This lets us remove `rustc_errors`'s dependency on `rustc_ast`, completing the disentangling of the AST crates and the error crates.
1 parent 6f5c379 commit 6ee5111

7 files changed

Lines changed: 4 additions & 7 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3908,7 +3908,6 @@ dependencies = [
39083908
"anstream",
39093909
"anstyle",
39103910
"derive_setters",
3911-
"rustc_ast",
39123911
"rustc_data_structures",
39133912
"rustc_error_codes",
39143913
"rustc_error_messages",

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
3030
use rustc_data_structures::tagged_ptr::Tag;
3131
use rustc_macros::{Decodable, Encodable, HashStable_Generic, Walkable};
3232
pub use rustc_span::AttrId;
33+
pub use rustc_span::node_id::{self, CRATE_NODE_ID, DUMMY_NODE_ID, NodeId};
3334
use rustc_span::{
3435
ByteSymbol, DUMMY_SP, ErrorGuaranteed, HashStableContext, Ident, Span, Spanned, Symbol, kw,
3536
respan, sym,
@@ -370,8 +371,6 @@ impl ParenthesizedArgs {
370371
}
371372
}
372373

373-
pub use crate::node_id::{CRATE_NODE_ID, DUMMY_NODE_ID, NodeId};
374-
375374
/// Modifiers on a trait bound like `[const]`, `?` and `!`.
376375
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, Walkable)]
377376
pub struct TraitBoundModifiers {

compiler/rustc_ast/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ pub mod entry;
2929
pub mod expand;
3030
pub mod format;
3131
pub mod mut_visit;
32-
pub mod node_id;
3332
pub mod token;
3433
pub mod tokenstream;
3534
pub mod visit;

compiler/rustc_errors/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ annotate-snippets = { version = "0.12.15", features = ["simd"] }
99
anstream = "0.6.20"
1010
anstyle = "1.0.13"
1111
derive_setters = "0.1.6"
12-
rustc_ast = { path = "../rustc_ast" }
1312
rustc_data_structures = { path = "../rustc_data_structures" }
1413
rustc_error_codes = { path = "../rustc_error_codes" }
1514
rustc_error_messages = { path = "../rustc_error_messages" }

compiler/rustc_errors/src/decorate_diag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::any::Any;
22

3-
/// This module provides types and traits for buffering lints until later in compilation.
4-
use rustc_ast::node_id::NodeId;
53
use rustc_data_structures::fx::FxIndexMap;
64
use rustc_data_structures::sync::{DynSend, DynSync};
75
use rustc_error_messages::MultiSpan;
86
use rustc_lint_defs::{AttributeLintKind, Lint, LintId};
7+
/// This module provides types and traits for buffering lints until later in compilation.
8+
use rustc_span::node_id::NodeId;
99

1010
use crate::{Diag, DiagCtxtHandle, Diagnostic, Level};
1111

compiler/rustc_span/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pub use hygiene::{
5555
pub mod def_id;
5656
use def_id::{CrateNum, DefId, DefIndex, DefPathHash, LOCAL_CRATE, LocalDefId, StableCrateId};
5757
pub mod edit_distance;
58+
pub mod node_id;
5859
mod span_encoding;
5960
pub use span_encoding::{DUMMY_SP, Span};
6061

0 commit comments

Comments
 (0)