Add term to ExistentialProjection

Also prevent ICE when adding a const in associated const equality.
This commit is contained in:
kadmin
2022-01-13 07:39:58 +00:00
parent f396888c4d
commit 1c1ce2fbda
35 changed files with 213 additions and 71 deletions

View File

@@ -559,7 +559,10 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
let name = cx.tcx.associated_item(projection.item_def_id).ident;
cx.push("p");
cx.push_ident(name.as_str());
cx = projection.ty.print(cx)?;
cx = match projection.term {
ty::Term::Ty(ty) => ty.print(cx),
ty::Term::Const(c) => c.print(cx),
}?;
}
ty::ExistentialPredicate::AutoTrait(def_id) => {
cx = cx.print_def_path(*def_id, &[])?;