Skip to content

Commit 19d1fe2

Browse files
committed
make unevaluated const substs optional
1 parent 4d627fc commit 19d1fe2

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

clippy_lints/src/non_copy_const.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,7 @@ fn is_value_unfrozen_expr<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId, def_id: D
187187

188188
let result = cx.tcx.const_eval_resolve(
189189
cx.param_env,
190-
ty::Unevaluated {
191-
def: ty::WithOptConstParam::unknown(def_id),
192-
substs,
193-
promoted: None,
194-
},
190+
ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs),
195191
None,
196192
);
197193
is_value_unfrozen_raw(cx, result, ty)

clippy_lints/src/redundant_clone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,8 @@ struct ContainsRegion<'tcx>(TyCtxt<'tcx>);
705705

706706
impl<'tcx> TypeVisitor<'tcx> for ContainsRegion<'tcx> {
707707
type BreakTy = ();
708-
fn tcx_for_anon_const_substs(&self) -> TyCtxt<'tcx> {
709-
self.0
708+
fn tcx_for_anon_const_substs(&self) -> Option<TyCtxt<'tcx>> {
709+
Some(self.0)
710710
}
711711

712712
fn visit_region(&mut self, _: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {

clippy_utils/src/consts.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
346346
.tcx
347347
.const_eval_resolve(
348348
self.param_env,
349-
ty::Unevaluated {
350-
def: ty::WithOptConstParam::unknown(def_id),
351-
substs,
352-
promoted: None,
353-
},
349+
ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs),
354350
None,
355351
)
356352
.ok()

0 commit comments

Comments
 (0)