Skip to content

Commit

Permalink
update const_eval_resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Mar 20, 2021
1 parent 2c4570c commit 731c98b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 9 additions & 1 deletion clippy_lints/src/non_copy_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,15 @@ fn is_value_unfrozen_expr<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId, def_id: D

let result = cx
.tcx
.const_eval_resolve(cx.param_env, ty::WithOptConstParam::unknown(def_id), substs, None, None);
.const_eval_resolve(
cx.param_env,
ty::Unevaluated {
def: ty::WithOptConstParam::unknown(def_id),
substs,
promoted: None
},
None
);
is_value_unfrozen_raw(cx, result, ty)
}

Expand Down
8 changes: 5 additions & 3 deletions clippy_utils/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,11 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
.tcx
.const_eval_resolve(
self.param_env,
ty::WithOptConstParam::unknown(def_id),
substs,
None,
ty::Unevaluated {
def: ty::WithOptConstParam::unknown(def_id),
substs,
promoted: None,
},
None,
)
.ok()
Expand Down

0 comments on commit 731c98b

Please sign in to comment.