diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-29 13:49:53 -0400 |
|---|---|---|
| committer | Jubilee Young <workingjubilee@gmail.com> | 2024-10-10 11:46:51 -0700 |
| commit | 322c4bdac595e7689dcf08b847d0bd4d82a4bad9 (patch) | |
| tree | 2d2b65808828d37b0c86e2ca8f7b03334c82cce7 | |
| parent | 36076ecdc726c4e1104e70df2d142f39501a4f48 (diff) | |
| download | rust-322c4bdac595e7689dcf08b847d0bd4d82a4bad9.tar.gz rust-322c4bdac595e7689dcf08b847d0bd4d82a4bad9.zip | |
Don't fire refinement lint if there are errors
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs index 80334c6efe7..2d6b9813271 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs @@ -64,6 +64,10 @@ pub(super) fn check_refining_return_position_impl_trait_in_trait<'tcx>( return; }; + if hidden_tys.items().any(|(_, &ty)| ty.skip_binder().references_error()) { + return; + } + let mut collector = ImplTraitInTraitCollector { tcx, types: FxIndexSet::default() }; trait_m_sig.visit_with(&mut collector); |
