mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
normalize before matching on ConstKind
This commit is contained in:
parent
b6852428a8
commit
9f438bef0b
@ -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(_, _)
|
||||
|
@ -0,0 +1,12 @@
|
||||
// check-pass
|
||||
#![feature(generic_const_exprs)]
|
||||
#![allow(incomplete_features, unused_braces)]
|
||||
|
||||
#[rustfmt::skip]
|
||||
fn foo<const N: usize>() {
|
||||
bar::<{{{{{{ N }}}}}}>();
|
||||
}
|
||||
|
||||
fn bar<const N: usize>() {}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user