1
Fork 0

Rollup merge of #105400 - BoxyUwU:braced_param_evaluatability, r=oli-obk

normalize before handling simple checks for evaluatability of `ty::Const`

`{{{{{{{ N }}}}}}}` is desugared into a `ConstKind::Unevaluated` for an anonymous `const` item so when calling `is_const_evaluatable` on it we skip the `ConstKind::Param(_) => Ok(())` arm which is incorrect.
This commit is contained in:
Matthias Krüger 2022-12-07 15:39:08 +01:00 committed by GitHub
commit b23419b03d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -30,7 +30,7 @@ pub fn is_const_evaluatable<'tcx>(
span: Span,
) -> Result<(), NotConstEvaluatable> {
let tcx = infcx.tcx;
match unexpanded_ct.kind() {
match tcx.expand_abstract_consts(unexpanded_ct).kind() {
ty::ConstKind::Unevaluated(_) | ty::ConstKind::Expr(_) => (),
ty::ConstKind::Param(_)
| ty::ConstKind::Bound(_, _)