Change:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. If you cannot produce a minimal reproduction case (something that would work in isolation), please provide the steps or even link to a repository that causes the problematic output to occur. --Given the following code: Diesel has a larger amount of compile test to check whether some constructs are rejected at compile time and to check for specific error messages. These tests are implemented using trybuild. We pin specific compiler versions as the output obviously might change with newer compiler versions. From time to time an update of the pinned version is required. While doing such an update we noticed that newer versions of rustc do emit non-deterministic error messages. These sometimes include more or less information. To reproduce this behaviour perform the following steps: We do not observe this behaviour with . I've observed this behaviour at least since (that's the earliest nightly I've checked, so there might be earlier versions as well) Exemplary changes between two runs (obviously that changes as well): <!-- If the problem is not self-explanatory, please provide a rationale for the change. --<!-- If dramatically different output is caused by small changes, consider also adding them here. If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. The output might also be different depending on the Edition. --<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
If you have time, it would be helpful to find exactly which commit regressed this (using ).
searched nightlies: from nightly-2022-08-12 to nightly-2022-09-15 regressed nightly: nightly-2022-08-23 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.5</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: : </detailscc as author of the relevant PR
I'll take a look. claim

Discussion:
TupleArgumentsFlag, }; use rustc_ast as ast; <del> use rustc_data_structures::fx::FxHashSet; </del> <ins> use rustc_data_structures::fx::FxIndexSet; </ins> use rustc_errors::{pluralize, Applicability, Diagnostic, DiagnosticId, MultiSpan}; use rustc_hir as hir; use rustc_hir::def::{CtorOf, DefKind, Res};

// even if their `ObligationCauseCode` isn't an `Expr*Obligation` kind. // This is important since if we adjust one span but not the other, then // we will have "duplicated" the error on the UI side. <del> let mut remap_cause = FxHashSet::default(); </del> <ins> let mut remap_cause = FxIndexSet::default(); </ins> let mut not_adjusted = vec![]; for error in errors {

} } <ins> // Adjust any other errors that come from other cause codes, when these // errors are of the same predicate as one we successfully adjusted, and // when their spans overlap (suggesting they're due to the same root cause). // // This is because due to normalization, we often register duplicate // obligations with misc obligations that are basically impossible to // line back up with a useful ExprBindingObligation. </ins> for error in not_adjusted { for (span, predicate, cause) in &remap_cause { if *predicate == error.obligation.predicate