1
Fork 0

UPDATE - move SessionDiagnostic from rustc_session to rustc_errors

This commit is contained in:
Jhonny Bill Mena 2022-09-07 09:36:08 -04:00
parent b79b7d8b4e
commit 5b8152807c
16 changed files with 33 additions and 30 deletions

View file

@ -13,6 +13,15 @@ use std::marker::PhantomData;
use std::ops::{Deref, DerefMut};
use std::thread::panicking;
/// Trait implemented by error types. This should not be implemented manually. Instead, use
/// `#[derive(SessionDiagnostic)]` -- see [rustc_macros::SessionDiagnostic].
#[rustc_diagnostic_item = "SessionDiagnostic"]
pub trait SessionDiagnostic<'a, T: EmissionGuarantee = ErrorGuaranteed> {
/// Write out as a diagnostic out of `Handler`.
#[must_use]
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, T>;
}
/// Used for emitting structured error messages and other diagnostic information.
///
/// If there is some state in a downstream crate you would like to

View file

@ -60,6 +60,7 @@ mod snippet;
mod styled_buffer;
pub mod translation;
pub use diagnostic_builder::SessionDiagnostic;
pub use snippet::Style;
pub type PResult<'a, T> = Result<T, DiagnosticBuilder<'a, ErrorGuaranteed>>;