]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Auto merge of #105485 - nnethercote:fix-lint-perf-regressions, r=cjgillot
[rust.git] / compiler / rustc_trait_selection / src / traits / error_reporting / mod.rs
index dda7b2b2fa5b0b392ce3d19f080c236152a8284e..82449a36b1d54115320fbc52c17d5f7ebdcdf5de 100644 (file)
@@ -597,6 +597,7 @@ fn report_selection_error(
                 // can get a better error message by performing HIR-based well-formedness checking.
                 if let ObligationCauseCode::WellFormed(Some(wf_loc)) =
                     root_obligation.cause.code().peel_derives()
+                    && !obligation.predicate.has_non_region_infer()
                 {
                     if let Some(cause) = self
                         .tcx