Skip to content

Commit a9594c1

Browse files
committed
fix ICE on type error in promoted
1 parent 7cc19d7 commit a9594c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clippy_lints/src/non_copy_const.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_hir::{
1111
BodyId, Expr, ExprKind, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, Node, TraitItem, TraitItemKind, UnOp,
1212
};
1313
use rustc_lint::{LateContext, LateLintPass, Lint};
14-
use rustc_middle::mir::interpret::{ErrorHandled, EvalToValTreeResult, GlobalId};
14+
use rustc_middle::mir::interpret::{ErrorHandled, EvalToValTreeResult, GlobalId, ReportedErrorInfo};
1515
use rustc_middle::ty::adjustment::Adjust;
1616
use rustc_middle::ty::{self, Ty, TyCtxt};
1717
use rustc_session::impl_lint_pass;
@@ -302,7 +302,10 @@ impl<'tcx> NonCopyConst<'tcx> {
302302
tcx.const_eval_global_id_for_typeck(typing_env, cid, span)
303303
},
304304
Ok(None) => Err(ErrorHandled::TooGeneric(span)),
305-
Err(err) => Err(ErrorHandled::Reported(err.into(), span)),
305+
Err(err) => Err(ErrorHandled::Reported(
306+
ReportedErrorInfo::non_const_eval_error(err),
307+
span,
308+
)),
306309
}
307310
}
308311
}

0 commit comments

Comments
 (0)