Fix const-generics ICE related to binding
This commit is contained in:
parent
ce331ee6ee
commit
242ac57015
5 changed files with 150 additions and 1 deletions
|
@ -115,7 +115,14 @@ fn resolve_associated_item<'tcx>(
|
|||
);
|
||||
|
||||
let trait_ref = ty::TraitRef::from_method(tcx, trait_id, rcvr_substs);
|
||||
let vtbl = tcx.codegen_fulfill_obligation((param_env, ty::Binder::bind(trait_ref, tcx)))?;
|
||||
let vtbl = if trait_item.kind == ty::AssocKind::Const {
|
||||
let bound_vars = tcx
|
||||
.mk_bound_variable_kinds(std::iter::once(ty::BoundVariableKind::Region(ty::BrAnon(0))));
|
||||
let bind = ty::Binder::bind_with_vars(trait_ref, bound_vars);
|
||||
tcx.codegen_fulfill_obligation((param_env, bind))?
|
||||
} else {
|
||||
tcx.codegen_fulfill_obligation((param_env, ty::Binder::bind(trait_ref, tcx)))?
|
||||
};
|
||||
|
||||
// Now that we know which impl is being used, we can dispatch to
|
||||
// the actual function:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue