mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
migrate debugger_visualizer.rs to translateable diagnostics
This commit is contained in:
parent
c103c3059f
commit
1e86226e9d
@ -13,6 +13,8 @@ use rustc_span::{sym, DebuggerVisualizerFile, DebuggerVisualizerType};
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::errors::DebugVisualizerUnreadable;
|
||||
|
||||
fn check_for_debugger_visualizer<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
hir_id: HirId,
|
||||
@ -54,13 +56,12 @@ fn check_for_debugger_visualizer<'tcx>(
|
||||
debugger_visualizers
|
||||
.insert(DebuggerVisualizerFile::new(Arc::from(contents), visualizer_type));
|
||||
}
|
||||
Err(err) => {
|
||||
tcx.sess
|
||||
.struct_span_err(
|
||||
meta_item.span,
|
||||
&format!("couldn't read {}: {}", file.display(), err),
|
||||
)
|
||||
.emit();
|
||||
Err(error) => {
|
||||
tcx.sess.emit_err(DebugVisualizerUnreadable {
|
||||
span: meta_item.span,
|
||||
file: &file,
|
||||
error,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user