@@ -958,7 +958,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
958
958
let use_cache = !selcx. is_intercrate ( ) ;
959
959
960
960
let projection_ty = infcx. resolve_vars_if_possible ( projection_ty) ;
961
- let cache_key = ProjectionCacheKey :: new ( projection_ty) ;
961
+ let cache_key = ProjectionCacheKey :: new ( ty :: Binder :: dummy ( projection_ty) ) ;
962
962
963
963
// FIXME(#20304) For now, I am caching here, which is good, but it
964
964
// means we don't capture the type variables that are created in
@@ -2123,14 +2123,12 @@ impl<'cx, 'tcx> ProjectionCacheKeyExt<'cx, 'tcx> for ProjectionCacheKey<'tcx> {
2123
2123
let infcx = selcx. infcx ( ) ;
2124
2124
// We don't do cross-snapshot caching of obligations with escaping regions,
2125
2125
// so there's no cache key to use
2126
- predicate. no_bound_vars ( ) . map ( |predicate| {
2127
- ProjectionCacheKey :: new (
2128
- // We don't attempt to match up with a specific type-variable state
2129
- // from a specific call to `opt_normalize_projection_type` - if
2130
- // there's no precise match, the original cache entry is "stranded"
2131
- // anyway.
2132
- infcx. resolve_vars_if_possible ( predicate. projection_ty ) ,
2133
- )
2134
- } )
2126
+ Some ( ProjectionCacheKey :: new ( predicate. map_bound ( |predicate| {
2127
+ // We don't attempt to match up with a specific type-variable state
2128
+ // from a specific call to `opt_normalize_projection_type` - if
2129
+ // there's no precise match, the original cache entry is "stranded"
2130
+ // anyway.
2131
+ infcx. resolve_vars_if_possible ( predicate. projection_ty )
2132
+ } ) ) )
2135
2133
}
2136
2134
}
0 commit comments