Skip to content

Commit

Permalink
Move ParseSess to librustc_session
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Dec 3, 2019
1 parent 817d1ae commit 52d4d47
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/librustc_session/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pub mod utils;
#[macro_use]
pub mod lint;
pub mod node_id;
pub mod parse;
11 changes: 7 additions & 4 deletions src/libsyntax/sess.rs → src/librustc_session/parse.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Contains `ParseSess` which holds state living beyond what one `Parser` might.
//! It also serves as an input to the parser itself.

use crate::ast::{CrateConfig, NodeId};
use crate::early_buffered_lints::BufferedEarlyLint;
use crate::node_id::NodeId;
use crate::lint::BufferedEarlyLint;

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

// Duplicated from syntax::ast for now
type CrateConfig = FxHashSet<(Symbol, Option<Symbol>)>;

/// Collected spans during parsing for places where a certain feature was
/// used and should be feature gated accordingly in `check_crate`.
#[derive(Default)]
Expand Down Expand Up @@ -137,7 +140,7 @@ impl ParseSess {

pub fn buffer_lint(
&self,
lint_id: &'static rustc_session::lint::Lint,
lint_id: &'static crate::lint::Lint,
span: impl Into<MultiSpan>,
id: NodeId,
msg: &str,
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub mod ptr;
pub mod show_span;
pub use syntax_pos::edition;
pub use syntax_pos::symbol;
pub mod sess;
pub use rustc_session::parse as sess;
pub mod token;
pub mod tokenstream;
pub mod visit;
Expand Down

0 comments on commit 52d4d47

Please sign in to comment.