We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 097ce04 commit 87fe433Copy full SHA for 87fe433
compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
@@ -85,6 +85,12 @@ pub fn is_const_evaluatable<'tcx>(
85
}
86
_ => bug!("unexpected constkind in `is_const_evalautable: {unexpanded_ct:?}`"),
87
88
+ } else if tcx.features().min_generic_const_args() {
89
+ // This is a sanity check to make sure that non-generics consts are checked to
90
+ // be evaluatable in case they aren't cchecked elsewhere. This will NOT error
91
+ // if the const uses generics, as desired.
92
+ crate::traits::evaluate_const(infcx, unexpanded_ct, param_env);
93
+ Ok(())
94
} else {
95
let uv = match unexpanded_ct.kind() {
96
ty::ConstKind::Unevaluated(uv) => uv,
0 commit comments