ty::Error(_) => p!("[type error]"),
ty::Param(ref param_ty) => p!(print(param_ty)),
ty::Bound(debruijn, bound_ty) => match bound_ty.kind {
- ty::BoundTyKind::Anon => self.pretty_print_bound_var(debruijn, bound_ty.var)?,
- ty::BoundTyKind::Param(p) => p!(write("{}", p)),
+ ty::BoundTyKind::Anon(bv) => {
+ self.pretty_print_bound_var(debruijn, ty::BoundVar::from_u32(bv))?
+ }
+ ty::BoundTyKind::Param(_, s) => p!(write("{}", s)),
},
ty::Adt(def, substs) => {
p!(print_def_path(def.did(), substs));
write!(self, "Sized")?;
}
- for re in lifetimes {
- write!(self, " + ")?;
- self = self.print_region(re)?;
+ if !FORCE_TRIMMED_PATH.with(|flag| flag.get()) {
+ for re in lifetimes {
+ write!(self, " + ")?;
+ self = self.print_region(re)?;
+ }
}
Ok(self)
return true;
}
+ if FORCE_TRIMMED_PATH.with(|flag| flag.get()) {
+ return false;
+ }
+
let identify_regions = self.tcx.sess.opts.unstable_opts.identify_regions;
match *region {
} else {
let tcx = self.tcx;
+ let trim_path = FORCE_TRIMMED_PATH.with(|flag| flag.get());
// Closure used in `RegionFolder` to create names for anonymous late-bound
// regions. We use two `DebruijnIndex`es (one for the currently folded
// late-bound region and the other for the binder level) to determine
}
};
- start_or_continue(&mut self, "for<", ", ");
- do_continue(&mut self, name);
+ if !trim_path {
+ start_or_continue(&mut self, "for<", ", ");
+ do_continue(&mut self, name);
+ }
tcx.mk_region(ty::ReLateBound(ty::INNERMOST, ty::BoundRegion { var: br.var, kind }))
};
let mut folder = RegionFolder {
};
let new_value = value.clone().skip_binder().fold_with(&mut folder);
let region_map = folder.region_map;
- start_or_continue(&mut self, "", "> ");
+ if !trim_path {
+ start_or_continue(&mut self, "", "> ");
+ }
(new_value, region_map)
};