}
match result {
- Ok(ConstVal::Integral(x)) => Some(x),
+ Ok(&ty::Const { val: ConstVal::Integral(x), .. }) => Some(x),
_ => None
}
} else if let Some(discr) = repr_type.disr_incr(tcx, prev_discr) {
fn visit_lifetime(&mut self, lt: &'tcx hir::Lifetime) {
if self.has_late_bound_regions.is_some() { return }
- match self.tcx.named_region_map.defs.get(<.id).cloned() {
+ let hir_id = self.tcx.hir.node_to_hir_id(lt.id);
+ match self.tcx.named_region(hir_id) {
Some(rl::Region::Static) | Some(rl::Region::EarlyBound(..)) => {}
Some(rl::Region::LateBound(debruijn, _)) |
Some(rl::Region::LateBoundAnon(debruijn, _))
tcx, binder_depth: 1, has_late_bound_regions: None
};
for lifetime in &generics.lifetimes {
- if tcx.named_region_map.late_bound.contains(&lifetime.lifetime.id) {
+ let hir_id = tcx.hir.node_to_hir_id(lifetime.lifetime.id);
+ if tcx.is_late_bound(hir_id) {
return Some(lifetime.lifetime.span);
}
}
}
}).collect::<Vec<_>>();
- let object_lifetime_defaults =
- tcx.named_region_map.object_lifetime_defaults.get(&node_id);
+ let hir_id = tcx.hir.node_to_hir_id(node_id);
+ let object_lifetime_defaults = tcx.object_lifetime_defaults(hir_id);
// Now create the real type parameters.
let type_start = own_start + regions.len() as u32;
def_id: tcx.hir.local_def_id(p.id),
has_default: p.default.is_some(),
object_lifetime_default:
- object_lifetime_defaults.map_or(rl::Set1::Empty, |o| o[i]),
+ object_lifetime_defaults.as_ref().map_or(rl::Set1::Empty, |o| o[i]),
pure_wrt_drop: p.pure_wrt_drop,
}
});
}
}
- let kind_id = tcx.lang_items.require(SizedTraitLangItem);
+ let kind_id = tcx.lang_items().require(SizedTraitLangItem);
match unbound {
Some(ref tpb) => {
// FIXME(#8559) currently requires the unbound to be built-in.
ast_generics
.lifetimes
.iter()
- .filter(move |l| !tcx.named_region_map.late_bound.contains(&l.lifetime.id))
+ .filter(move |l| {
+ let hir_id = tcx.hir.node_to_hir_id(l.lifetime.id);
+ !tcx.is_late_bound(hir_id)
+ })
}
fn predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
/// a region) to ty's notion of ty param bounds, which can either be user-defined traits, or the
/// built-in trait (formerly known as kind): Send.
pub fn compute_bounds<'gcx: 'tcx, 'tcx>(astconv: &AstConv<'gcx, 'tcx>,
- param_ty: ty::Ty<'tcx>,
+ param_ty: Ty<'tcx>,
ast_bounds: &[hir::TyParamBound],
sized_by_default: SizedByDefault,
span: Span)
// ABIs are handled at all correctly.
if abi != abi::Abi::RustIntrinsic && abi != abi::Abi::PlatformIntrinsic
&& !tcx.sess.features.borrow().simd_ffi {
- let check = |ast_ty: &hir::Ty, ty: ty::Ty| {
+ let check = |ast_ty: &hir::Ty, ty: Ty| {
if ty.is_simd() {
tcx.sess.struct_span_err(ast_ty.span,
&format!("use of SIMD type `{}` in FFI is highly experimental and \