mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 04:24:43 +00:00
impl Error for CompileError
This commit is contained in:
parent
7fad8d9eee
commit
792c0ca3b4
3 changed files with 22 additions and 2 deletions
|
@ -564,6 +564,19 @@ pub trait ErrorDisplay {
|
|||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! impl_display_and_error {
|
||||
($Strc: ident) => {
|
||||
impl std::fmt::Display for $Strc {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
$crate::error::ErrorDisplay::format(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for $Strc {}
|
||||
};
|
||||
}
|
||||
|
||||
pub trait MultiErrorDisplay<Item: ErrorDisplay>: Stream<Item> {
|
||||
fn fmt_all_stderr(&self) {
|
||||
for err in self.iter() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue