mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
dump lints _after_ parsing macros
This commit is contained in:
parent
b206aedb1b
commit
6cb09ccf9f
@ -697,13 +697,6 @@ pub fn phase_1_parse_input<'a>(
|
||||
hir_stats::print_ast_stats(&krate, "PRE EXPANSION AST STATS");
|
||||
}
|
||||
|
||||
// Add all buffered lints from the `ParseSess` to the `Session`.
|
||||
let mut parse_sess_buffered = sess.parse_sess.buffered_lints.borrow_mut();
|
||||
for BufferedEarlyLint{id, span, msg, lint_id} in parse_sess_buffered.drain(..) {
|
||||
let lint = lint::Lint::from_parser_lint_id(lint_id);
|
||||
sess.buffer_lint(lint, id, span, &msg);
|
||||
}
|
||||
|
||||
Ok(krate)
|
||||
}
|
||||
|
||||
@ -1074,6 +1067,15 @@ where
|
||||
)
|
||||
});
|
||||
|
||||
// Add all buffered lints from the `ParseSess` to the `Session`.
|
||||
sess.parse_sess.buffered_lints.with_lock(|buffered_lints| {
|
||||
info!("{} parse sess buffered_lints", buffered_lints.len());
|
||||
for BufferedEarlyLint{id, span, msg, lint_id} in buffered_lints.drain(..) {
|
||||
let lint = lint::Lint::from_parser_lint_id(lint_id);
|
||||
sess.buffer_lint(lint, id, span, &msg);
|
||||
}
|
||||
});
|
||||
|
||||
// Done with macro expansion!
|
||||
|
||||
after_expand(&krate)?;
|
||||
|
@ -96,14 +96,14 @@ impl ParseSess {
|
||||
id: NodeId,
|
||||
msg: &str,
|
||||
) {
|
||||
self.buffered_lints
|
||||
.borrow_mut()
|
||||
.push(BufferedEarlyLint{
|
||||
self.buffered_lints.with_lock(|buffered_lints| {
|
||||
buffered_lints.push(BufferedEarlyLint{
|
||||
span: span.into(),
|
||||
id,
|
||||
msg: msg.into(),
|
||||
lint_id,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user