1
Fork 0

add const-evaluatable_checked check back in

This commit is contained in:
Bastian Kauschke 2020-09-18 17:36:11 +02:00
parent 09e6254496
commit b7641209d7

View file

@ -30,8 +30,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
span: Span, span: Span,
) -> Result<(), ErrorHandled> { ) -> Result<(), ErrorHandled> {
debug!("is_const_evaluatable({:?}, {:?})", def, substs); debug!("is_const_evaluatable({:?}, {:?})", def, substs);
// `AbstractConst::new` already returns `None` if `const_evaluatable_checked` if infcx.tcx.features().const_evaluatable_checked {
// is not active, so we don't have to explicitly check for this here.
if let Some(ct) = AbstractConst::new(infcx.tcx, def, substs) { if let Some(ct) = AbstractConst::new(infcx.tcx, def, substs) {
for pred in param_env.caller_bounds() { for pred in param_env.caller_bounds() {
match pred.skip_binders() { match pred.skip_binders() {
@ -51,6 +50,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
} }
} }
} }
}
let future_compat_lint = || { let future_compat_lint = || {
if let Some(local_def_id) = def.did.as_local() { if let Some(local_def_id) = def.did.as_local() {