simple errors for lang-dev
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 95f7717..fc5dc19 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -35,6 +35,15 @@ impl<S: ToString> From<(Span, S)> for Label {
}
}
+impl<S: ToString> From<(&Span, S)> for Label {
+ fn from((span, m): (&Span, S)) -> Self {
+ Self {
+ span: span.clone(),
+ message: m.to_string(),
+ }
+ }
+}
+
/// A note at the end of the diagnostic
#[derive(Debug)]
pub struct Note {