|
1 | 1 | use super::*; |
2 | 2 |
|
3 | | -use crate::ast::CrateConfig; |
4 | 3 | use crate::symbol::Symbol; |
5 | 4 | use crate::source_map::{SourceMap, FilePathMapping}; |
6 | | -use crate::feature_gate::UnstableFeatures; |
7 | 5 | use crate::parse::token; |
8 | | -use crate::diagnostics::plugin::ErrorMap; |
9 | 6 | use crate::with_default_globals; |
10 | 7 | use std::io; |
11 | 8 | use std::path::PathBuf; |
12 | | -use syntax_pos::{BytePos, Span, edition::Edition}; |
13 | | -use rustc_data_structures::fx::{FxHashSet, FxHashMap}; |
14 | | -use rustc_data_structures::sync::{Lock, Once}; |
| 9 | +use errors::{Handler, emitter::EmitterWriter}; |
| 10 | +use syntax_pos::{BytePos, Span}; |
15 | 11 |
|
16 | 12 | fn mk_sess(sm: Lrc<SourceMap>) -> ParseSess { |
17 | | - let emitter = errors::emitter::EmitterWriter::new(Box::new(io::sink()), |
18 | | - Some(sm.clone()), |
19 | | - false, |
20 | | - false, |
21 | | - false); |
22 | | - ParseSess { |
23 | | - span_diagnostic: errors::Handler::with_emitter(true, None, Box::new(emitter)), |
24 | | - unstable_features: UnstableFeatures::from_environment(), |
25 | | - config: CrateConfig::default(), |
26 | | - included_mod_stack: Lock::new(Vec::new()), |
27 | | - source_map: sm, |
28 | | - missing_fragment_specifiers: Lock::new(FxHashSet::default()), |
29 | | - raw_identifier_spans: Lock::new(Vec::new()), |
30 | | - registered_diagnostics: Lock::new(ErrorMap::new()), |
31 | | - buffered_lints: Lock::new(vec![]), |
32 | | - edition: Edition::from_session(), |
33 | | - ambiguous_block_expr_parse: Lock::new(FxHashMap::default()), |
34 | | - param_attr_spans: Lock::new(Vec::new()), |
35 | | - let_chains_spans: Lock::new(Vec::new()), |
36 | | - async_closure_spans: Lock::new(Vec::new()), |
37 | | - injected_crate_name: Once::new(), |
38 | | - } |
| 13 | + let emitter = EmitterWriter::new(Box::new(io::sink()), Some(sm.clone()), false, false, false); |
| 14 | + ParseSess::with_span_handler(Handler::with_emitter(true, None, Box::new(emitter)), sm) |
39 | 15 | } |
40 | 16 |
|
41 | 17 | // open a string reader for the given string |
|
0 commit comments