.map(|&u| {
tcx.mk_const(ty::Const {
val: ConstValue::Scalar(
- Scalar::Bits {
- bits: u,
- size: size.bytes() as u8,
- }.into(),
+ Scalar::from_uint(u, size).into(),
),
ty: switch_ty,
}).to_string().into()
/// a single deref of a local.
//
// FIXME: can we safely swap the semantics of `fn base_local` below in here instead?
- pub fn local(&self) -> Option<Local> {
+ pub fn local_or_deref_local(&self) -> Option<Local> {
match self {
Place::Base(PlaceBase::Local(local)) |
Place::Projection(box Projection {
if let Some(upvars) = tcx.upvars(def_id) {
for (upvar, place) in upvars.iter().zip(places) {
- let var_name = tcx.hir().name_by_hir_id(upvar.var_id());
+ let var_name = tcx.hir().name_by_hir_id(upvar.var_id);
struct_fmt.field(&var_name.as_str(), place);
}
}
if let Some(upvars) = tcx.upvars(def_id) {
for (upvar, place) in upvars.iter().zip(places) {
- let var_name = tcx.hir().name_by_hir_id(upvar.var_id());
+ let var_name = tcx.hir().name_by_hir_id(upvar.var_id);
struct_fmt.field(&var_name.as_str(), place);
}
}