This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
compiler/rustc_hir_analysis/src/collect/type_of Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,10 @@ pub(super) fn find_opaque_ty_constraints_for_rpit<'tcx>(
278278
279279 let mir_opaque_ty = tcx. mir_borrowck ( owner_def_id) . concrete_opaque_types . get ( & def_id) . copied ( ) ;
280280 if let Some ( mir_opaque_ty) = mir_opaque_ty {
281+ if mir_opaque_ty. references_error ( ) {
282+ return mir_opaque_ty. ty ;
283+ }
284+
281285 let scope = tcx. local_def_id_to_hir_id ( owner_def_id) ;
282286 debug ! ( ?scope) ;
283287 let mut locator = RpitConstraintChecker { def_id, tcx, found : mir_opaque_ty } ;
Original file line number Diff line number Diff line change 1+ trait Foo { }
2+
3+ trait T {
4+ fn a ( & self ) -> impl Foo {
5+ self . b ( || 0 )
6+ //~^ ERROR no method named `b` found for reference `&Self` in the current scope
7+ }
8+ }
9+
10+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0599]: no method named `b` found for reference `&Self` in the current scope
2+ --> $DIR/issue-117794.rs:5:14
3+ |
4+ LL | self.b(|| 0)
5+ | ^ help: there is a method with a similar name: `a`
6+
7+ error: aborting due to 1 previous error
8+
9+ For more information about this error, try `rustc --explain E0599`.
You can’t perform that action at this time.
0 commit comments