@@ -71,8 +71,8 @@ impl<'a, 'tcx, T: Copy + Decodable<DecodeContext<'a, 'tcx>>> ProcessQueryValue<'
71
71
for Option < DecodeIterator < ' a , ' tcx , T > >
72
72
{
73
73
#[ inline( always) ]
74
- fn process_decoded ( self , tcx : TyCtxt < ' tcx > , _err : impl Fn ( ) -> !) -> & ' tcx [ T ] {
75
- if let Some ( iter) = self { tcx. arena . alloc_from_iter ( iter) } else { & [ ] }
74
+ fn process_decoded ( self , tcx : TyCtxt < ' tcx > , err : impl Fn ( ) -> !) -> & ' tcx [ T ] {
75
+ if let Some ( iter) = self { tcx. arena . alloc_from_iter ( iter) } else { err ( ) }
76
76
}
77
77
}
78
78
@@ -84,12 +84,12 @@ impl<'a, 'tcx, T: Copy + Decodable<DecodeContext<'a, 'tcx>>>
84
84
fn process_decoded (
85
85
self ,
86
86
tcx : TyCtxt < ' tcx > ,
87
- _err : impl Fn ( ) -> !,
87
+ err : impl Fn ( ) -> !,
88
88
) -> ty:: EarlyBinder < ' tcx , & ' tcx [ T ] > {
89
89
ty:: EarlyBinder :: bind ( if let Some ( iter) = self {
90
90
tcx. arena . alloc_from_iter ( iter)
91
91
} else {
92
- & [ ]
92
+ err ( )
93
93
} )
94
94
}
95
95
}
@@ -301,7 +301,20 @@ provide! { tcx, def_id, other, cdata,
301
301
. unwrap_or_else( || panic!( "{def_id:?} does not have eval_static_initializer" ) ) )
302
302
}
303
303
trait_def => { table }
304
- deduced_param_attrs => { table }
304
+ deduced_param_attrs => {
305
+ // FIXME: `deduced_param_attrs` has some sketchy encoding settings,
306
+ // where we don't encode unless we're optimizing, doing codegen,
307
+ // and not incremental (see `encoder.rs`). I don't think this is right!
308
+ cdata
309
+ . root
310
+ . tables
311
+ . deduced_param_attrs
312
+ . get( cdata, def_id. index)
313
+ . map( |lazy| {
314
+ & * tcx. arena. alloc_from_iter( lazy. decode( ( cdata, tcx) ) )
315
+ } )
316
+ . unwrap_or_default( )
317
+ }
305
318
is_type_alias_impl_trait => {
306
319
debug_assert_eq!( tcx. def_kind( def_id) , DefKind :: OpaqueTy ) ;
307
320
cdata. root. tables. is_type_alias_impl_trait. get( cdata, def_id. index)
0 commit comments