use errors::emitter::{Emitter, EmitterWriter};
use errors::emitter::HumanReadableErrorType;
use errors::annotate_snippet_emitter_writer::{AnnotateSnippetEmitterWriter};
-use syntax::ast::{self, NodeId};
use syntax::edition::Edition;
use syntax::expand::allocator::AllocatorKind;
use syntax::feature_gate::{self, AttributeType};
use ::jobserver::Client;
use std;
-use std::cell::{self, Cell, RefCell};
+use std::cell::{self, RefCell};
use std::env;
use std::fmt;
use std::io::Write;
/// Data about code being compiled, gathered during compilation.
pub code_stats: Lock<CodeStats>,
- next_node_id: OneThread<Cell<ast::NodeId>>,
-
/// If `-zfuel=crate=n` is specified, `Some(crate)`.
optimization_fuel_crate: Option<String>,
self.diagnostic().span_note_without_error(sp, msg)
}
- pub fn reserve_node_ids(&self, count: usize) -> ast::NodeId {
- let id = self.next_node_id.get();
-
- match id.as_usize().checked_add(count) {
- Some(next) => {
- self.next_node_id.set(ast::NodeId::from_usize(next));
- }
- None => bug!("input too large; ran out of node-IDs!"),
- }
-
- id
- }
- pub fn next_node_id(&self) -> NodeId {
- self.reserve_node_ids(1)
- }
pub fn diagnostic(&self) -> &errors::Handler {
&self.parse_sess.span_diagnostic
}
recursion_limit: Once::new(),
type_length_limit: Once::new(),
const_eval_stack_frame_limit: 100,
- next_node_id: OneThread::new(Cell::new(NodeId::from_u32(1))),
allocator_kind: Once::new(),
injected_panic_runtime: Once::new(),
imported_macro_spans: OneThread::new(RefCell::new(FxHashMap::default())),