migrate debugger_visualizer.rs to translateable diagnostics
This commit is contained in:
parent
c103c3059f
commit
1e86226e9d
1 changed files with 8 additions and 7 deletions
|
@ -13,6 +13,8 @@ use rustc_span::{sym, DebuggerVisualizerFile, DebuggerVisualizerType};
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use crate::errors::DebugVisualizerUnreadable;
|
||||||
|
|
||||||
fn check_for_debugger_visualizer<'tcx>(
|
fn check_for_debugger_visualizer<'tcx>(
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
hir_id: HirId,
|
hir_id: HirId,
|
||||||
|
@ -54,13 +56,12 @@ fn check_for_debugger_visualizer<'tcx>(
|
||||||
debugger_visualizers
|
debugger_visualizers
|
||||||
.insert(DebuggerVisualizerFile::new(Arc::from(contents), visualizer_type));
|
.insert(DebuggerVisualizerFile::new(Arc::from(contents), visualizer_type));
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(error) => {
|
||||||
tcx.sess
|
tcx.sess.emit_err(DebugVisualizerUnreadable {
|
||||||
.struct_span_err(
|
span: meta_item.span,
|
||||||
meta_item.span,
|
file: &file,
|
||||||
&format!("couldn't read {}: {}", file.display(), err),
|
error,
|
||||||
)
|
});
|
||||||
.emit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue