File tree 3 files changed +32
-1
lines changed
compiler/rustc_hir_analysis/src/check
3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ fn compare_method_predicate_entailment<'tcx>(
302
302
return Err ( emitted) ;
303
303
}
304
304
305
- if check_implied_wf == CheckImpliedWfMode :: Check {
305
+ if check_implied_wf == CheckImpliedWfMode :: Check && ! ( impl_sig , trait_sig ) . references_error ( ) {
306
306
// We need to check that the impl's args are well-formed given
307
307
// the hybrid param-env (impl + trait method where-clauses).
308
308
ocx. register_obligation ( traits:: Obligation :: new (
Original file line number Diff line number Diff line change
1
+ trait Identity {
2
+ type Identity ;
3
+ }
4
+ impl < T > Identity for T {
5
+ type Identity = T ;
6
+ }
7
+
8
+ trait Trait {
9
+ type Assoc : Identity ;
10
+ fn tokenize ( & self ) -> <Self :: Assoc as Identity >:: Identity ;
11
+ }
12
+
13
+ impl Trait for ( ) {
14
+ type Assoc = DoesNotExist ;
15
+ //~^ ERROR cannot find type `DoesNotExist` in this scope
16
+
17
+ fn tokenize ( & self ) -> <Self :: Assoc as Identity >:: Identity {
18
+ unimplemented ! ( )
19
+ }
20
+ }
21
+
22
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0412]: cannot find type `DoesNotExist` in this scope
2
+ --> $DIR/references-err.rs:14:18
3
+ |
4
+ LL | type Assoc = DoesNotExist;
5
+ | ^^^^^^^^^^^^ not found in this scope
6
+
7
+ error: aborting due to previous error
8
+
9
+ For more information about this error, try `rustc --explain E0412`.
You can’t perform that action at this time.
0 commit comments