@@ -2,7 +2,7 @@ use super::OverlapError;
2
2
3
3
use crate :: traits;
4
4
use rustc_hir:: def_id:: DefId ;
5
- use rustc_middle:: ty:: fast_reject:: { self , SimplifiedType } ;
5
+ use rustc_middle:: ty:: fast_reject:: { self , StableSimplifiedType } ;
6
6
use rustc_middle:: ty:: print:: with_no_trimmed_paths;
7
7
use rustc_middle:: ty:: { self , TyCtxt , TypeFoldable } ;
8
8
@@ -40,7 +40,7 @@ trait ChildrenExt {
40
40
& mut self ,
41
41
tcx : TyCtxt < ' tcx > ,
42
42
impl_def_id : DefId ,
43
- simplified_self : Option < SimplifiedType > ,
43
+ simplified_self : Option < StableSimplifiedType > ,
44
44
) -> Result < Inserted , OverlapError > ;
45
45
}
46
46
@@ -50,7 +50,7 @@ impl ChildrenExt for Children {
50
50
let trait_ref = tcx. impl_trait_ref ( impl_def_id) . unwrap ( ) ;
51
51
if let Some ( st) = fast_reject:: simplify_type ( tcx, trait_ref. self_ty ( ) , false ) {
52
52
debug ! ( "insert_blindly: impl_def_id={:?} st={:?}" , impl_def_id, st) ;
53
- self . nonblanket_impls . entry ( st) . or_default ( ) . push ( impl_def_id)
53
+ self . nonblanket_impls . entry ( st. to_stable ( tcx ) ) . or_default ( ) . push ( impl_def_id)
54
54
} else {
55
55
debug ! ( "insert_blindly: impl_def_id={:?} st=None" , impl_def_id) ;
56
56
self . blanket_impls . push ( impl_def_id)
@@ -65,7 +65,7 @@ impl ChildrenExt for Children {
65
65
let vec: & mut Vec < DefId > ;
66
66
if let Some ( st) = fast_reject:: simplify_type ( tcx, trait_ref. self_ty ( ) , false ) {
67
67
debug ! ( "remove_existing: impl_def_id={:?} st={:?}" , impl_def_id, st) ;
68
- vec = self . nonblanket_impls . get_mut ( & st) . unwrap ( ) ;
68
+ vec = self . nonblanket_impls . get_mut ( & st. to_stable ( tcx ) ) . unwrap ( ) ;
69
69
} else {
70
70
debug ! ( "remove_existing: impl_def_id={:?} st=None" , impl_def_id) ;
71
71
vec = & mut self . blanket_impls ;
@@ -81,7 +81,7 @@ impl ChildrenExt for Children {
81
81
& mut self ,
82
82
tcx : TyCtxt < ' tcx > ,
83
83
impl_def_id : DefId ,
84
- simplified_self : Option < SimplifiedType > ,
84
+ simplified_self : Option < StableSimplifiedType > ,
85
85
) -> Result < Inserted , OverlapError > {
86
86
let mut last_lint = None ;
87
87
let mut replace_children = Vec :: new ( ) ;
@@ -222,7 +222,7 @@ fn iter_children(children: &mut Children) -> impl Iterator<Item = DefId> + '_ {
222
222
223
223
fn filtered_children (
224
224
children : & mut Children ,
225
- st : SimplifiedType ,
225
+ st : StableSimplifiedType ,
226
226
) -> impl Iterator < Item = DefId > + ' _ {
227
227
let nonblanket = children. nonblanket_impls . entry ( st) . or_default ( ) . iter ( ) ;
228
228
children. blanket_impls . iter ( ) . chain ( nonblanket) . cloned ( )
@@ -304,7 +304,8 @@ impl GraphExt for Graph {
304
304
305
305
let mut parent = trait_def_id;
306
306
let mut last_lint = None ;
307
- let simplified = fast_reject:: simplify_type ( tcx, trait_ref. self_ty ( ) , false ) ;
307
+ let simplified =
308
+ fast_reject:: simplify_type ( tcx, trait_ref. self_ty ( ) , false ) . map ( |st| st. to_stable ( tcx) ) ;
308
309
309
310
// Descend the specialization tree, where `parent` is the current parent node.
310
311
loop {
0 commit comments