1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
use diagnostic_example::{diagnostic_item, diagnostic_expr};
fn main() {
diagnostic_item! {
error: just an item error,
_note: see an item,
help: I can help with that,
}
diagnostic_expr! {
error: just an expression error item context,
_note: see an exp,
_warning: kind of weird,
help: I can help with that,
}
let x = diagnostic_expr! {
error: just an expression error expr content,
_warning: oh no,
};
}
diagnostic_item! {
error: this is an item error message,
}
diagnostic_item! {
error: this is an error message,
_note: but it has a note,
}
diagnostic_item! {
error: hello,
warning: just wanted to warn you,
note: just jotting things down,
_help: please help on that note,
_note: notes on notes,
}
diagnostic_item! {
warning: hello not found,
_note: just a note to say hi,
_help: its a good idea to say hello,
}
diagnostic_item! {
hello: hello,
}
diagnostic_item! {
help: this is standalone help,
_note: but we add things to it,
_help: like more help,
}
|