1
Fork 0

Handle Fn family trait call errror

This commit is contained in:
Deadbeef 2021-12-29 17:05:54 +08:00
parent 6d6314f878
commit d3acb9d00e
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9
10 changed files with 57 additions and 13 deletions

View file

@ -196,8 +196,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
.map(|n| format!("`{}`", n))
.unwrap_or_else(|| "value".to_owned());
match kind {
CallKind::FnCall(once_did)
if Some(once_did) == self.infcx.tcx.lang_items().fn_once_trait() =>
CallKind::FnCall { fn_trait_id, .. }
if Some(fn_trait_id) == self.infcx.tcx.lang_items().fn_once_trait() =>
{
err.span_label(
fn_call_span,