Changes from review
This commit is contained in:
parent
e54854f6a9
commit
5a69b5d0f9
6 changed files with 25 additions and 20 deletions
|
@ -23,7 +23,7 @@ use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState};
|
|||
use rustc_middle::ty::codec::TyDecoder;
|
||||
use rustc_middle::ty::fast_reject::SimplifiedType;
|
||||
use rustc_middle::ty::GeneratorDiagnosticData;
|
||||
use rustc_middle::ty::{self, ParameterizedOverTcx, Ty, TyCtxt, Visibility};
|
||||
use rustc_middle::ty::{self, ParameterizedOverTcx, Predicate, Ty, TyCtxt, Visibility};
|
||||
use rustc_serialize::opaque::MemDecoder;
|
||||
use rustc_serialize::{Decodable, Decoder};
|
||||
use rustc_session::cstore::{
|
||||
|
@ -857,6 +857,20 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
|||
)
|
||||
}
|
||||
|
||||
fn get_explicit_item_bounds(
|
||||
self,
|
||||
index: DefIndex,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
) -> ty::EarlyBinder<&'tcx [(Predicate<'tcx>, Span)]> {
|
||||
let lazy = self.root.tables.explicit_item_bounds.get(self, index);
|
||||
let output = if lazy.is_default() {
|
||||
&mut []
|
||||
} else {
|
||||
tcx.arena.alloc_from_iter(lazy.decode((self, tcx)))
|
||||
};
|
||||
ty::EarlyBinder(&*output)
|
||||
}
|
||||
|
||||
fn get_variant(self, kind: &DefKind, index: DefIndex, parent_did: DefId) -> ty::VariantDef {
|
||||
let adt_kind = match kind {
|
||||
DefKind::Variant => ty::AdtKind::Enum,
|
||||
|
|
|
@ -203,11 +203,7 @@ impl IntoArgs for (CrateNum, SimplifiedType) {
|
|||
}
|
||||
|
||||
provide! { tcx, def_id, other, cdata,
|
||||
explicit_item_bounds => {
|
||||
let lazy = cdata.root.tables.explicit_item_bounds.get(cdata, def_id.index);
|
||||
let output = if lazy.is_default() { &mut [] } else { tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx))) };
|
||||
ty::EarlyBinder(&*output)
|
||||
}
|
||||
explicit_item_bounds => { cdata.get_explicit_item_bounds(def_id.index, tcx) }
|
||||
explicit_predicates_of => { table }
|
||||
generics_of => { table }
|
||||
inferred_outlives_of => { table_defaulted_array }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue