提交 372b1a59 编写于 作者: E Eduard-Mihai Burtescu

rustc: uniformize all lift expect messages to "could not lift for printing".

上级 297546e6
......@@ -648,11 +648,11 @@ fn print<F: fmt::Write>(&self, f: &mut F, cx: &mut PrintContext) -> fmt::Result
if let Some(principal) = self.principal() {
let principal = tcx
.lift(&principal)
.expect("could not lift TraitRef for printing")
.expect("could not lift for printing")
.with_self_ty(tcx, dummy_self);
let projections = self.projection_bounds().map(|p| {
tcx.lift(&p)
.expect("could not lift projection for printing")
.expect("could not lift for printing")
.with_self_ty(tcx, dummy_self)
}).collect::<Vec<_>>();
cx.parameterized(f, principal.substs, principal.def_id, &projections)?;
......@@ -781,7 +781,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let dummy_self = tcx.mk_infer(ty::FreshTy(0));
let trait_ref = *tcx.lift(&ty::Binder::bind(*self))
.expect("could not lift TraitRef for printing")
.expect("could not lift for printing")
.with_self_ty(tcx, dummy_self).skip_binder();
cx.parameterized(f, trait_ref.substs, trait_ref.def_id, &[])
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册