Rollup merge of #101162 - rajputrajat:master, r=davidtwco

Migrate rustc_resolve to use SessionDiagnostic, part # 1

crate a somewhat on larger size, so plz allow some time to get it finished.
This commit is contained in:
Matthias Krüger
2022-11-18 14:13:35 +01:00
committed by GitHub
9 changed files with 884 additions and 362 deletions

View File

@@ -211,6 +211,12 @@ impl IntoDiagnosticArg for DiagnosticSymbolList {
}
}
impl<Id> IntoDiagnosticArg for hir::def::Res<Id> {
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
DiagnosticArgValue::Str(Cow::Borrowed(self.descr()))
}
}
impl IntoDiagnostic<'_, !> for TargetDataLayoutErrors<'_> {
fn into_diagnostic(self, handler: &Handler) -> DiagnosticBuilder<'_, !> {
let mut diag;