Closed
Description
I recently discovered that the following code compiles:
#![feature(min_const_generics)]
struct Bar<const C: bool>;
struct Foo {
outer: Bar<{
struct Inner {
field: bool
}
true
}>,
}
It looks like an AnonConst
is allowed to contain arbitrary expressions (as long as no const or type parameters are used), which means that new types can be defined.
I'm not certain whether this should be allowed or not. However, I haven't seen this discussed before, so I thought it was worth bringing up.