let def_id = field.did;
debug!("IsolatedEncoder::encode_field({:?})", def_id);
- let variant_id = tcx.hir().as_local_node_id(variant.did).unwrap();
+ let variant_id = tcx.hir().as_local_hir_id(variant.did).unwrap();
let variant_data = tcx.hir().expect_variant_data(variant_id);
Entry {
}
}
+ fn encode_info_for_const_param(&mut self, def_id: DefId) -> Entry<'tcx> {
+ debug!("IsolatedEncoder::encode_info_for_const_param({:?})", def_id);
+ let tcx = self.tcx;
+ Entry {
+ kind: EntryKind::Type,
+ visibility: self.lazy(&ty::Visibility::Public),
+ span: self.lazy(&tcx.def_span(def_id)),
+ attributes: LazySeq::empty(),
+ children: LazySeq::empty(),
+ stability: None,
+ deprecation: None,
+
+ ty: Some(self.encode_item_type(def_id)),
+ inherent_impls: LazySeq::empty(),
+ variances: LazySeq::empty(),
+ generics: None,
+ predicates: None,
+ predicates_defined_on: None,
+
+ mir: None,
+ }
+ }
+
fn encode_info_for_closure(&mut self, def_id: DefId) -> Entry<'tcx> {
debug!("IsolatedEncoder::encode_info_for_closure({:?})", def_id);
let tcx = self.tcx;
let tables = self.tcx.typeck_tables_of(def_id);
let node_id = self.tcx.hir().as_local_node_id(def_id).unwrap();
let hir_id = self.tcx.hir().node_to_hir_id(node_id);
- let kind = match tables.node_id_to_type(hir_id).sty {
+ let kind = match tables.node_type(hir_id).sty {
ty::Generator(def_id, ..) => {
let layout = self.tcx.generator_layout(def_id);
let data = GeneratorData {
let encode_info = IsolatedEncoder::encode_info_for_ty_param;
self.record(def_id, encode_info, (def_id, has_default));
}
+ hir::GenericParamKind::Const { .. } => {
+ let def_id = self.tcx.hir().local_def_id(param.id);
+ let encode_info = IsolatedEncoder::encode_info_for_const_param;
+ self.record(def_id, encode_info, def_id);
+ }
}
}
}