pub struct Error {
pub path: String,
pub line: u32,
pub column: u32,
pub message: String,
}Expand description
A place in a rule file and what is wrong there.
The compiler’s own diagnostics carry a code, a caret and a source map, and none of that is
wanted here. A rule file is read by cargo xtask rules and its errors are read by whoever
is editing the rules, in a build log, so the shape that belongs here is the one every other
build tool prints: the file, the position, and one sentence. Spending a number out of the
compiler’s diagnostic sequence on it would also be wrong, because those numbers are part of
what a user of the compiler can look up, and nobody compiling a C program will ever see one
of these.
Fields§
§path: StringThe file the rule was read from, as it should be printed.
line: u32The line, counted from one.
column: u32The column, counted from one, in characters.
message: StringWhat is wrong, as a sentence with no trailing full stop.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()