From e0106d99d699bbb427f4ebb156a343cc26159e11 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Mon, 29 Oct 2018 14:50:30 +0100 Subject: Assert that promoteds don't fail to be evaluated for being too generic --- src/librustc_mir/const_eval.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/const_eval.rs b/src/librustc_mir/const_eval.rs index 7db9c3f1102..38ab21b7c8c 100644 --- a/src/librustc_mir/const_eval.rs +++ b/src/librustc_mir/const_eval.rs @@ -576,7 +576,11 @@ pub fn const_eval_provider<'a, 'tcx>( key.param_env.reveal = Reveal::UserFacing; match tcx.const_eval(key) { // try again with reveal all as requested - Err(ErrorHandled::TooGeneric) => {}, + Err(ErrorHandled::TooGeneric) => { + // Promoteds should never be "too generic" when getting evaluated. + // They either don't get evaluated, or we are in a monomorphic context + assert!(key.value.promoted.is_none()); + }, // dedupliate calls other => return other, } -- cgit 1.4.1-3-g733a5