mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Move ParseSess to librustc_session
This commit is contained in:
parent
817d1ae834
commit
52d4d478a1
@ -3,3 +3,4 @@ pub mod utils;
|
||||
#[macro_use]
|
||||
pub mod lint;
|
||||
pub mod node_id;
|
||||
pub mod parse;
|
||||
|
@ -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;
|
||||
@ -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)]
|
||||
@ -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,
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user