1
Fork 0

Make Span optional in BufferedEarlyLint

This commit is contained in:
Urgau 2024-06-22 12:38:10 +02:00
parent 6a2cd0d50c
commit eedb32dd12
5 changed files with 31 additions and 7 deletions

View file

@ -753,7 +753,7 @@ pub enum BuiltinLintDiag {
#[derive(Debug)]
pub struct BufferedEarlyLint {
/// The span of code that we are linting on.
pub span: MultiSpan,
pub span: Option<MultiSpan>,
/// The `NodeId` of the AST node that generated the lint.
pub node_id: NodeId,
@ -791,7 +791,7 @@ impl LintBuffer {
self.add_early_lint(BufferedEarlyLint {
lint_id: LintId::of(lint),
node_id,
span: span.into(),
span: Some(span.into()),
diagnostic,
});
}