mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +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]
|
#[macro_use]
|
||||||
pub mod lint;
|
pub mod lint;
|
||||||
pub mod node_id;
|
pub mod node_id;
|
||||||
|
pub mod parse;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//! Contains `ParseSess` which holds state living beyond what one `Parser` might.
|
//! Contains `ParseSess` which holds state living beyond what one `Parser` might.
|
||||||
//! It also serves as an input to the parser itself.
|
//! It also serves as an input to the parser itself.
|
||||||
|
|
||||||
use crate::ast::{CrateConfig, NodeId};
|
use crate::node_id::NodeId;
|
||||||
use crate::early_buffered_lints::BufferedEarlyLint;
|
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::fx::{FxHashSet, FxHashMap};
|
||||||
use rustc_data_structures::sync::{Lrc, Lock, Once};
|
use rustc_data_structures::sync::{Lrc, Lock, Once};
|
||||||
use rustc_feature::UnstableFeatures;
|
use rustc_feature::UnstableFeatures;
|
||||||
@ -16,6 +16,9 @@ use syntax_pos::source_map::{SourceMap, FilePathMapping};
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::str;
|
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
|
/// Collected spans during parsing for places where a certain feature was
|
||||||
/// used and should be feature gated accordingly in `check_crate`.
|
/// used and should be feature gated accordingly in `check_crate`.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
@ -137,7 +140,7 @@ impl ParseSess {
|
|||||||
|
|
||||||
pub fn buffer_lint(
|
pub fn buffer_lint(
|
||||||
&self,
|
&self,
|
||||||
lint_id: &'static rustc_session::lint::Lint,
|
lint_id: &'static crate::lint::Lint,
|
||||||
span: impl Into<MultiSpan>,
|
span: impl Into<MultiSpan>,
|
||||||
id: NodeId,
|
id: NodeId,
|
||||||
msg: &str,
|
msg: &str,
|
@ -102,7 +102,7 @@ pub mod ptr;
|
|||||||
pub mod show_span;
|
pub mod show_span;
|
||||||
pub use syntax_pos::edition;
|
pub use syntax_pos::edition;
|
||||||
pub use syntax_pos::symbol;
|
pub use syntax_pos::symbol;
|
||||||
pub mod sess;
|
pub use rustc_session::parse as sess;
|
||||||
pub mod token;
|
pub mod token;
|
||||||
pub mod tokenstream;
|
pub mod tokenstream;
|
||||||
pub mod visit;
|
pub mod visit;
|
||||||
|
Loading…
Reference in New Issue
Block a user