Skip to content

Commit 52d4d47

Browse files
Move ParseSess to librustc_session
1 parent 817d1ae commit 52d4d47

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/librustc_session/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pub mod utils;
33
#[macro_use]
44
pub mod lint;
55
pub mod node_id;
6+
pub mod parse;

src/libsyntax/sess.rs renamed to src/librustc_session/parse.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Contains `ParseSess` which holds state living beyond what one `Parser` might.
22
//! It also serves as an input to the parser itself.
33
4-
use crate::ast::{CrateConfig, NodeId};
5-
use crate::early_buffered_lints::BufferedEarlyLint;
4+
use crate::node_id::NodeId;
5+
use crate::lint::BufferedEarlyLint;
66

7-
use errors::{Applicability, emitter::SilentEmitter, Handler, ColorConfig, DiagnosticBuilder};
7+
use rustc_errors::{Applicability, emitter::SilentEmitter, Handler, ColorConfig, DiagnosticBuilder};
88
use rustc_data_structures::fx::{FxHashSet, FxHashMap};
99
use rustc_data_structures::sync::{Lrc, Lock, Once};
1010
use rustc_feature::UnstableFeatures;
@@ -16,6 +16,9 @@ use syntax_pos::source_map::{SourceMap, FilePathMapping};
1616
use std::path::PathBuf;
1717
use std::str;
1818

19+
// Duplicated from syntax::ast for now
20+
type CrateConfig = FxHashSet<(Symbol, Option<Symbol>)>;
21+
1922
/// Collected spans during parsing for places where a certain feature was
2023
/// used and should be feature gated accordingly in `check_crate`.
2124
#[derive(Default)]
@@ -137,7 +140,7 @@ impl ParseSess {
137140

138141
pub fn buffer_lint(
139142
&self,
140-
lint_id: &'static rustc_session::lint::Lint,
143+
lint_id: &'static crate::lint::Lint,
141144
span: impl Into<MultiSpan>,
142145
id: NodeId,
143146
msg: &str,

src/libsyntax/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub mod ptr;
102102
pub mod show_span;
103103
pub use syntax_pos::edition;
104104
pub use syntax_pos::symbol;
105-
pub mod sess;
105+
pub use rustc_session::parse as sess;
106106
pub mod token;
107107
pub mod tokenstream;
108108
pub mod visit;

0 commit comments

Comments
 (0)