make unevaluated const substs optional
This commit is contained in:
@@ -187,11 +187,7 @@ fn is_value_unfrozen_expr<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId, def_id: D
|
|||||||
|
|
||||||
let result = cx.tcx.const_eval_resolve(
|
let result = cx.tcx.const_eval_resolve(
|
||||||
cx.param_env,
|
cx.param_env,
|
||||||
ty::Unevaluated {
|
ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs),
|
||||||
def: ty::WithOptConstParam::unknown(def_id),
|
|
||||||
substs,
|
|
||||||
promoted: None,
|
|
||||||
},
|
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
is_value_unfrozen_raw(cx, result, ty)
|
is_value_unfrozen_raw(cx, result, ty)
|
||||||
|
|||||||
@@ -705,8 +705,8 @@ struct ContainsRegion<'tcx>(TyCtxt<'tcx>);
|
|||||||
|
|
||||||
impl<'tcx> TypeVisitor<'tcx> for ContainsRegion<'tcx> {
|
impl<'tcx> TypeVisitor<'tcx> for ContainsRegion<'tcx> {
|
||||||
type BreakTy = ();
|
type BreakTy = ();
|
||||||
fn tcx_for_anon_const_substs(&self) -> TyCtxt<'tcx> {
|
fn tcx_for_anon_const_substs(&self) -> Option<TyCtxt<'tcx>> {
|
||||||
self.0
|
Some(self.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_region(&mut self, _: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
|
fn visit_region(&mut self, _: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||||
|
|||||||
@@ -346,11 +346,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
|
|||||||
.tcx
|
.tcx
|
||||||
.const_eval_resolve(
|
.const_eval_resolve(
|
||||||
self.param_env,
|
self.param_env,
|
||||||
ty::Unevaluated {
|
ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs),
|
||||||
def: ty::WithOptConstParam::unknown(def_id),
|
|
||||||
substs,
|
|
||||||
promoted: None,
|
|
||||||
},
|
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
.ok()
|
.ok()
|
||||||
|
|||||||
Reference in New Issue
Block a user