[glsl-in] Use Span instead of SourceMetadata

This commit is contained in:
João Capucho authored and Dzmitry Malyshau committed 2021-09-21 11:00:33 -04:00
1 parent 42db64628e
commit af44603e47
18 files changed
+256 -348

No files matched your search

+5 -3
View File
@@ -465,9 +465,11 @@ pub fn emit_glsl_parser_error(errors: Vec<naga::front::glsl::Error>, filename: &
let writer = StandardStream::stderr(ColorChoice::Auto);
for err in errors {
let diagnostic = Diagnostic::error()
.with_message(err.kind.to_string())
.with_labels(vec![Label::primary((), err.meta.start..err.meta.end)]);
let mut diagnostic = Diagnostic::error().with_message(err.kind.to_string());
if let Some(range) = err.meta.to_range() {
diagnostic = diagnostic.with_labels(vec![Label::primary((), range)]);
}
term::emit(&mut writer.lock(), &config, &files, &diagnostic).expect("cannot write error");
}