File tree 3 files changed +19
-1
lines changed
test/ui/specialization/min_specialization
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: ich:: { self , StableHashingContext } ;
2
2
use crate :: ty:: fast_reject:: SimplifiedType ;
3
+ use crate :: ty:: fold:: TypeFoldable ;
3
4
use crate :: ty:: { self , TyCtxt } ;
4
5
use rustc_data_structures:: fx:: FxHashMap ;
5
6
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
@@ -226,7 +227,8 @@ pub fn ancestors(
226
227
start_from_impl : DefId ,
227
228
) -> Result < Ancestors < ' tcx > , ErrorReported > {
228
229
let specialization_graph = tcx. specialization_graph_of ( trait_def_id) ;
229
- if specialization_graph. has_errored {
230
+
231
+ if specialization_graph. has_errored || tcx. type_of ( start_from_impl) . references_error ( ) {
230
232
Err ( ErrorReported )
231
233
} else {
232
234
Ok ( Ancestors {
Original file line number Diff line number Diff line change
1
+ #![ feature( min_specialization) ]
2
+
3
+ trait Trait { }
4
+ impl Trait for NonExistent { }
5
+ //~^ ERROR cannot find type `NonExistent` in this scope
6
+
7
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0412]: cannot find type `NonExistent` in this scope
2
+ --> $DIR/impl-on-nonexisting.rs:4:16
3
+ |
4
+ LL | impl Trait for NonExistent {}
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