mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[glsl-in] Use Span instead of SourceMetadata
This commit is contained in:
committed by
Dzmitry Malyshau
parent
42db64628e
commit
af44603e47
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user