Checkpoint

This commit is contained in:
2023-10-14 16:39:16 -07:00
parent 87d027bf8d
commit 71228b9e09
18 changed files with 402 additions and 78 deletions

View File

@@ -85,9 +85,9 @@ impl Location {
/// the user with some guidance. That being said, you still might want to add
/// even more information to ut, using [`Diagnostic::with_labels`],
/// [`Diagnostic::with_notes`], or [`Diagnostic::with_code`].
pub fn labelled_error(&self, msg: &str) -> Diagnostic<usize> {
pub fn labelled_error<T: AsRef<str>>(&self, msg: T) -> Diagnostic<usize> {
Diagnostic::error().with_labels(vec![
Label::primary(self.file_idx, self.location.clone()).with_message(msg)
Label::primary(self.file_idx, self.location.clone()).with_message(msg.as_ref())
])
}