Adapt new change
This commit is contained in:
parent
d3acb9d00e
commit
cccf4b2fc3
1 changed files with 11 additions and 4 deletions
|
@ -832,10 +832,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Ok(Some(ImplSource::UserDefined(data))) => {
|
Ok(Some(ImplSource::UserDefined(data))) => {
|
||||||
if let hir::Constness::NotConst = tcx.impl_constness(data.impl_def_id) {
|
|
||||||
self.check_op(ops::FnCallNonConst(None));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let callee_name = tcx.item_name(callee);
|
let callee_name = tcx.item_name(callee);
|
||||||
if let Some(&did) = tcx
|
if let Some(&did) = tcx
|
||||||
.associated_item_def_ids(data.impl_def_id)
|
.associated_item_def_ids(data.impl_def_id)
|
||||||
|
@ -847,6 +843,17 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
||||||
substs = InternalSubsts::identity_for_item(tcx, did);
|
substs = InternalSubsts::identity_for_item(tcx, did);
|
||||||
callee = did;
|
callee = did;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let hir::Constness::NotConst = tcx.impl_constness(data.impl_def_id) {
|
||||||
|
self.check_op(ops::FnCallNonConst {
|
||||||
|
caller,
|
||||||
|
callee,
|
||||||
|
substs,
|
||||||
|
span: *fn_span,
|
||||||
|
from_hir_call: *from_hir_call,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ if !tcx.is_const_fn_raw(callee) => {
|
_ if !tcx.is_const_fn_raw(callee) => {
|
||||||
// At this point, it is only legal when the caller is marked with
|
// At this point, it is only legal when the caller is marked with
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue