blob: f6992c9a8a946c9a03e3c551aa4de492020f8b8d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
//! Diagnostics emitted during body lowering.
use hir_expand::diagnostics::DiagnosticSink;
use crate::diagnostics::{InactiveCode, MacroError, UnresolvedMacroCall, UnresolvedProcMacro};
#[derive(Debug, Eq, PartialEq)]
pub(crate) enum BodyDiagnostic {
InactiveCode(InactiveCode),
MacroError(MacroError),
UnresolvedProcMacro(UnresolvedProcMacro),
UnresolvedMacroCall(UnresolvedMacroCall),
}
impl BodyDiagnostic {
pub(crate) fn add_to(&self, sink: &mut DiagnosticSink<'_>) {
match self {
BodyDiagnostic::InactiveCode(diag) => {
sink.push(diag.clone());
}
BodyDiagnostic::MacroError(diag) => {
sink.push(diag.clone());
}
BodyDiagnostic::UnresolvedProcMacro(diag) => {
sink.push(diag.clone());
}
BodyDiagnostic::UnresolvedMacroCall(diag) => {
sink.push(diag.clone());
}
}
}
}
|