pub trait ErrorDisplay {
    fn core(&self) -> &ErrorCore;
    fn input(&self) -> &Input;
    fn caused_by(&self) -> &str;
    fn ref_inner(&self) -> Option<&Box<Self>>;

    fn write_to_stderr(&self) { ... }
    fn format(&self, f: &mut Formatter<'_>) -> Result { ... }
    fn format_header(&self) -> String { ... }
    fn format_code_and_pointer(&self) -> String { ... }
}
Expand description

format:

Error[#{.errno}]: File {file}, line {.loc (as line)}, in {.caused_by}
{.loc (as line)}| {src}
{pointer}
{.kind}: {.desc}

example:

Error[#12]: File <stdin>, line 1, in <module>
1| 100 = i
   ^^^
SyntaxError: cannot assign to 100

Required Methods

The block name the error caused. This will be None if the error occurred before semantic analysis. As for the internal error, do not put the fn name here.

the previous error that caused this error.

Provided Methods

fmt::Display実装用

Implementors