report_mismatch did not actually report anymore · rust-lang/rust@e4622e0 (original) (raw)

`@@ -59,7 +59,7 @@ pub(super) fn find_opaque_ty_constraints_for_impl_trait_in_assoc_type(

`

59

59

`if !hidden.ty.references_error() {

`

60

60

`for concrete_type in locator.typeck_types {

`

61

61

`if concrete_type.ty != tcx.erase_regions(hidden.ty) {

`

62

``

`-

if let Ok(d) = hidden.report_mismatch(&concrete_type, def_id, tcx) {

`

``

62

`+

if let Ok(d) = hidden.build_mismatch_error(&concrete_type, def_id, tcx) {

`

63

63

` d.emit();

`

64

64

`}

`

65

65

`}

`

`@@ -135,7 +135,7 @@ pub(super) fn find_opaque_ty_constraints_for_tait(tcx: TyCtxt<'_>, def_id: Local

`

135

135

`if !hidden.ty.references_error() {

`

136

136

`for concrete_type in locator.typeck_types {

`

137

137

`if concrete_type.ty != tcx.erase_regions(hidden.ty) {

`

138

``

`-

if let Ok(d) = hidden.report_mismatch(&concrete_type, def_id, tcx) {

`

``

138

`+

if let Ok(d) = hidden.build_mismatch_error(&concrete_type, def_id, tcx) {

`

139

139

` d.emit();

`

140

140

`}

`

141

141

`}

`

`@@ -289,7 +289,7 @@ impl TaitConstraintLocator<'_> {

`

289

289

`if let Some(prev) = &mut self.found {

`

290

290

`if concrete_type.ty != prev.ty {

`

291

291

`let (Ok(guar) | Err(guar)) = prev

`

292

``

`-

.report_mismatch(&concrete_type, self.def_id, self.tcx)

`

``

292

`+

.build_mismatch_error(&concrete_type, self.def_id, self.tcx)

`

293

293

`.map(|d| d.emit());

`

294

294

` prev.ty = Ty::new_error(self.tcx, guar);

`

295

295

`}

`

`@@ -364,7 +364,7 @@ pub(super) fn find_opaque_ty_constraints_for_rpit<'tcx>(

`

364

364

`);

`

365

365

`if let Some(prev) = &mut hir_opaque_ty {

`

366

366

`if concrete_type.ty != prev.ty {

`

367

``

`-

if let Ok(d) = prev.report_mismatch(&concrete_type, def_id, tcx) {

`

``

367

`+

if let Ok(d) = prev.build_mismatch_error(&concrete_type, def_id, tcx) {

`

368

368

` d.stash(

`

369

369

` tcx.def_span(opaque_type_key.def_id),

`

370

370

`StashKey::OpaqueHiddenTypeMismatch,

`

`@@ -441,7 +441,9 @@ impl RpitConstraintChecker<'_> {

`

441

441

`debug!(?concrete_type, "found constraint");

`

442

442

``

443

443

`if concrete_type.ty != self.found.ty {

`

444

``

`-

if let Ok(d) = self.found.report_mismatch(&concrete_type, self.def_id, self.tcx) {

`

``

444

`+

if let Ok(d) =

`

``

445

`+

self.found.build_mismatch_error(&concrete_type, self.def_id, self.tcx)

`

``

446

`+

{

`

445

447

` d.emit();

`

446

448

`}

`

447

449

`}

`