1 //! Diagnostics emitted during body lowering.
3 use hir_expand::diagnostics::DiagnosticSink;
5 use crate::diagnostics::{InactiveCode, MacroError, UnresolvedMacroCall, UnresolvedProcMacro};
7 #[derive(Debug, Eq, PartialEq)]
8 pub(crate) enum BodyDiagnostic {
9 InactiveCode(InactiveCode),
10 MacroError(MacroError),
11 UnresolvedProcMacro(UnresolvedProcMacro),
12 UnresolvedMacroCall(UnresolvedMacroCall),
16 pub(crate) fn add_to(&self, sink: &mut DiagnosticSink<'_>) {
18 BodyDiagnostic::InactiveCode(diag) => {
19 sink.push(diag.clone());
21 BodyDiagnostic::MacroError(diag) => {
22 sink.push(diag.clone());
24 BodyDiagnostic::UnresolvedProcMacro(diag) => {
25 sink.push(diag.clone());
27 BodyDiagnostic::UnresolvedMacroCall(diag) => {
28 sink.push(diag.clone());