Conversation
|
|
|
wait no I haven't had my coffee yet what am I doing, this isn't the right fix, one moment... (I mean, it worked, but, yeah, actual fix pushed now) |
cabcba9 to
d32dd9e
Compare
| if tcx.features().generic_const_args() | ||
| || matches!(def_kind, DefKind::Const | DefKind::AssocConst) | ||
| && tcx.is_direct_const(def_id) | ||
| if matches!(def_kind, DefKind::Const | DefKind::AssocConst) |
There was a problem hiding this comment.
haha when I was reviewing that PR I thought about how I hate precedence on these things and can never tell where the parens go 😆
|
what does the THIR look like for this test, where does a NamedConst come from with a defid of an anon 🤔 |
comes from here for reference this is what the code looks like: enum T<const N: u8 = { T::<0>::B as u8 }> {
A = 2,
B,
}the anon const for the default in
|
| @@ -80,9 +80,8 @@ pub(crate) fn as_constant_inner<'tcx>( | |||
There was a problem hiding this comment.
Should we mention about anon const exception here?
There was a problem hiding this comment.
when considering other wordings for this, I found myself unable write a wording to justify not doing the exception for just projection consts, rather than all const items. So I rewrote this to only do the exception for just projection consts.
d32dd9e to
acc7501
Compare
I'm really dumb, missed something obvious, and wasn't any test in the test suite to catch it.
Fixes #162923
Introduced in #162760
r? @BoxyUwU or @matthiaskrgr if you'd like