use util::common::{duration_to_secs_str, ErrorReported};
use util::common::ProfileQueriesMsg;
- use rustc_data_structures::sync::{Lrc, Lock, LockCell, OneThread, Once};
+ use rustc_data_structures::sync::{Lrc, Lock, LockCell, OneThread, Once, RwLock};
use syntax::ast::NodeId;
use errors::{self, DiagnosticBuilder, DiagnosticId};
// FIXME: lint_store and buffered_lints are not thread-safe,
// but are only used in a single thread
- pub lint_store: OneThread<RefCell<lint::LintStore>>,
- pub buffered_lints: OneThread<RefCell<Option<lint::LintBuffer>>>,
+ pub lint_store: RwLock<lint::LintStore>,
+ pub buffered_lints: Lock<Option<lint::LintBuffer>>,
/// Set of (DiagnosticId, Option<Span>, message) tuples tracking
/// (sub)diagnostics that have been set once, but should not be set again,
/// The maximum number of stackframes allowed in const eval
pub const_eval_stack_frame_limit: usize,
- /// The maximum number miri steps per constant
- pub const_eval_step_limit: usize,
/// The metadata::creader module may inject an allocator/panic_runtime
/// dependency if it didn't already find one, and this tracks what was
default_sysroot,
local_crate_source_file,
working_dir,
- lint_store: OneThread::new(RefCell::new(lint::LintStore::new())),
- buffered_lints: OneThread::new(RefCell::new(Some(lint::LintBuffer::new()))),
+ lint_store: RwLock::new(lint::LintStore::new()),
+ buffered_lints: Lock::new(Some(lint::LintBuffer::new())),
one_time_diagnostics: RefCell::new(FxHashSet()),
plugin_llvm_passes: OneThread::new(RefCell::new(Vec::new())),
plugin_attributes: OneThread::new(RefCell::new(Vec::new())),
recursion_limit: Once::new(),
type_length_limit: Once::new(),
const_eval_stack_frame_limit: 100,
- const_eval_step_limit: 1_000_000,
next_node_id: OneThread::new(Cell::new(NodeId::new(1))),
injected_allocator: Once::new(),
allocator_kind: Once::new(),
write_out_deps(sess, &outputs, &output_paths);
if sess.opts.output_types.contains_key(&OutputType::DepInfo) &&
- sess.opts.output_types.keys().count() == 1 {
+ sess.opts.output_types.len() == 1 {
return Ok(())
}
let mut ecx = ExtCtxt::new(&sess.parse_sess, cfg, &mut resolver);
let err_count = ecx.parse_sess.span_diagnostic.err_count();
- let krate = ecx.monotonic_expander().expand_crate(krate);
+ let krate = time(sess, "expand crate", || {
+ ecx.monotonic_expander().expand_crate(krate)
+ });
- ecx.check_unused_macros();
+ time(sess, "check unused macros", || {
+ ecx.check_unused_macros();
+ });
let mut missing_fragment_specifiers: Vec<_> =
ecx.parse_sess.missing_fragment_specifiers.borrow().iter().cloned().collect();