Auto merge of #120576 - nnethercote:merge-Diagnostic-DiagnosticBuilder, r=davidtwco
Overhaul `Diagnostic` and `DiagnosticBuilder` Implements the first part of https://github.com/rust-lang/compiler-team/issues/722, which moves functionality and use away from `Diagnostic`, onto `DiagnosticBuilder`. Likely follow-ups: - Move things around, because this PR was written to minimize diff size, so some things end up in sub-optimal places. E.g. `DiagnosticBuilder` has impls in both `diagnostic.rs` and `diagnostic_builder.rs`. - Rename `Diagnostic` as `DiagInner` and `DiagnosticBuilder` as `Diag`. r? `@davidtwco`
This commit is contained in:
commit
29f87ade9d
104 changed files with 1038 additions and 849 deletions
|
@ -29,7 +29,7 @@ use crate::traits::ProjectionCacheKey;
|
|||
use crate::traits::Unimplemented;
|
||||
use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
|
||||
use rustc_data_structures::stack::ensure_sufficient_stack;
|
||||
use rustc_errors::Diagnostic;
|
||||
use rustc_errors::{DiagnosticBuilder, EmissionGuarantee};
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_infer::infer::BoundRegionConversionTime;
|
||||
|
@ -70,7 +70,10 @@ pub enum IntercrateAmbiguityCause<'tcx> {
|
|||
impl<'tcx> IntercrateAmbiguityCause<'tcx> {
|
||||
/// Emits notes when the overlap is caused by complex intercrate ambiguities.
|
||||
/// See #23980 for details.
|
||||
pub fn add_intercrate_ambiguity_hint(&self, err: &mut Diagnostic) {
|
||||
pub fn add_intercrate_ambiguity_hint<G: EmissionGuarantee>(
|
||||
&self,
|
||||
err: &mut DiagnosticBuilder<'_, G>,
|
||||
) {
|
||||
err.note(self.intercrate_ambiguity_hint());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue