Slightly simplify feeding of assoc const eq bounds
This commit is contained in:
parent
b94498a378
commit
858d336209
1 changed files with 3 additions and 5 deletions
|
@ -433,12 +433,10 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Provide the resolved type of the associated constant to `type_of(AnonConst)`.
|
// Provide the resolved type of the associated constant to `type_of(AnonConst)`.
|
||||||
if !speculative && let ty::AssocKind::Const = assoc_kind {
|
if !speculative
|
||||||
let hir::TypeBindingKind::Equality { term: hir::Term::Const(anon_const) } =
|
&& let hir::TypeBindingKind::Equality { term: hir::Term::Const(anon_const) } =
|
||||||
binding.kind
|
binding.kind
|
||||||
else {
|
{
|
||||||
bug!()
|
|
||||||
};
|
|
||||||
let ty = alias_ty.map_bound(|ty| tcx.type_of(ty.def_id).instantiate(tcx, ty.args));
|
let ty = alias_ty.map_bound(|ty| tcx.type_of(ty.def_id).instantiate(tcx, ty.args));
|
||||||
// Since the arguments passed to the alias type above may contain early-bound
|
// Since the arguments passed to the alias type above may contain early-bound
|
||||||
// generic parameters, the instantiated type may contain some as well.
|
// generic parameters, the instantiated type may contain some as well.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue