You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a mechanism to emit diagnostic messages using StableMIR's Span. Maybe provide methods to emit error, warning, and note.
One possibility would be to provide an API similar to what is being proposed for proc_macro diagnostics:
// crate stable_mirpubfnspan_error(span:implSpans,message:implMessage) -> proc_macro::Diagnostic;pubfnspan_warn(span:implSpans,message:implMessage) -> proc_macro::Diagnostic;pubfnspan_note(span:implSpans,message:implMessage) -> proc_macro::Diagnostic;/// This could become an alias to proc_macro::Message once it gets added.pubtraitMessage;pubtraitSpans{/// Converts `self` into a `Vec<Span>`.fninto_spans(self) -> Vec<Span>;}implMessageforString;implMessagefor&str;implSpansforSpan;impl<I:IntoIterator<Item = Span>>SpansforI;impl<T> proc_macro::MultiSpanforTwhereT:Spans;
We should probably also add a function abort_if_errors() to allow tool developers to end some validation stage if any error was detected.
The text was updated successfully, but these errors were encountered:
Maybe we can add methods to retrieve the byte range of a span and the file content, so users can easily integrate with a diagnostic crate such as annotate-snippets or codespan-reporting.
Provide a mechanism to emit diagnostic messages using StableMIR's
Span
. Maybe provide methods to emit error, warning, and note.One possibility would be to provide an API similar to what is being proposed for proc_macro diagnostics:
We should probably also add a function
abort_if_errors()
to allow tool developers to end some validation stage if any error was detected.The text was updated successfully, but these errors were encountered: