Porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1

This commit is contained in:
Gabriel Bustamante 2022-08-26 13:08:58 -05:00
parent fb888117da
commit 8e82200277
12 changed files with 180 additions and 87 deletions

View file

@ -23,6 +23,7 @@ mod structural_match;
mod util;
pub mod wf;
use crate::errors::DumpVTableEntries;
use crate::infer::outlives::env::OutlivesEnvironment;
use crate::infer::{InferCtxt, TyCtxtInferExt};
use crate::traits::error_reporting::InferCtxtExt as _;
@ -763,8 +764,11 @@ fn dump_vtable_entries<'tcx>(
trait_ref: ty::PolyTraitRef<'tcx>,
entries: &[VtblEntry<'tcx>],
) {
let msg = format!("vtable entries for `{}`: {:#?}", trait_ref, entries);
tcx.sess.struct_span_err(sp, &msg).emit();
tcx.sess.emit_err(DumpVTableEntries {
span: sp,
trait_ref,
entries: format!("{:#?}", entries),
});
}
fn own_existential_vtable_entries<'tcx>(