Make Span
optional in BufferedEarlyLint
This commit is contained in:
parent
6a2cd0d50c
commit
eedb32dd12
5 changed files with 31 additions and 7 deletions
|
@ -306,10 +306,20 @@ impl ParseSess {
|
|||
span: impl Into<MultiSpan>,
|
||||
node_id: NodeId,
|
||||
diagnostic: BuiltinLintDiag,
|
||||
) {
|
||||
self.opt_span_buffer_lint(lint, Some(span.into()), node_id, diagnostic)
|
||||
}
|
||||
|
||||
pub fn opt_span_buffer_lint(
|
||||
&self,
|
||||
lint: &'static Lint,
|
||||
span: Option<MultiSpan>,
|
||||
node_id: NodeId,
|
||||
diagnostic: BuiltinLintDiag,
|
||||
) {
|
||||
self.buffered_lints.with_lock(|buffered_lints| {
|
||||
buffered_lints.push(BufferedEarlyLint {
|
||||
span: span.into(),
|
||||
span,
|
||||
node_id,
|
||||
lint_id: LintId::of(lint),
|
||||
diagnostic,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue