remove HirVisitor
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
This commit is contained in:
parent
885b90bb34
commit
0b7dd95475
2 changed files with 31 additions and 43 deletions
|
@ -16,7 +16,7 @@ use std::sync::Arc;
|
|||
fn check_for_debugger_visualizer<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
hir_id: HirId,
|
||||
debugger_visualizers: &mut FxHashSet<DebuggerVisualizerFile>
|
||||
debugger_visualizers: &mut FxHashSet<DebuggerVisualizerFile>,
|
||||
) {
|
||||
let attrs = tcx.hir().attrs(hir_id);
|
||||
for attr in attrs {
|
||||
|
@ -51,8 +51,7 @@ fn check_for_debugger_visualizer<'tcx>(
|
|||
let contents = match std::fs::read(&file) {
|
||||
Ok(contents) => contents,
|
||||
Err(err) => {
|
||||
tcx
|
||||
.sess
|
||||
tcx.sess
|
||||
.struct_span_err(
|
||||
attr.span,
|
||||
&format!(
|
||||
|
@ -71,12 +70,8 @@ fn check_for_debugger_visualizer<'tcx>(
|
|||
DebuggerVisualizerType::Natvis,
|
||||
));
|
||||
} else {
|
||||
tcx
|
||||
.sess
|
||||
.struct_span_err(
|
||||
attr.span,
|
||||
&format!("{} is not a valid file", file.display()),
|
||||
)
|
||||
tcx.sess
|
||||
.struct_span_err(attr.span, &format!("{} is not a valid file", file.display()))
|
||||
.emit();
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +96,6 @@ fn debugger_visualizers<'tcx>(tcx: TyCtxt<'tcx>, cnum: CrateNum) -> Vec<Debugger
|
|||
// Collect debugger visualizers on the crate attributes.
|
||||
check_for_debugger_visualizer(tcx, CRATE_HIR_ID, &mut debugger_visualizers);
|
||||
|
||||
|
||||
// Extract out the found debugger_visualizer items.
|
||||
let mut visualizers = debugger_visualizers.into_iter().collect::<Vec<_>>();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue