Skip to content

Commit f790ffa

Browse files
committed
1 parent 6d12259 commit f790ffa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
345345
promoted: None,
346346
};
347347

348-
let result = self.lcx.tcx.const_eval(self.param_env.and(gid)).ok()?;
348+
let result = self.lcx.tcx.const_eval_validated(self.param_env.and(gid)).ok()?;
349349
let result = miri_to_const(&result);
350350
if result.is_some() {
351351
self.needed_resolution = true;

clippy_lints/src/enum_clike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
5656
instance,
5757
promoted: None,
5858
};
59-
let constant = cx.tcx.const_eval(param_env.and(c_id)).ok();
59+
let constant = cx.tcx.const_eval_validated(param_env.and(c_id)).ok();
6060
if let Some(Constant::Int(val)) = constant.and_then(miri_to_const) {
6161
let mut ty = cx.tcx.type_of(def_id);
6262
if let ty::Adt(adt, _) = ty.kind {

0 commit comments

Comments
 (0)