implement #![feature(macroless_generic_const_args)]#159058
Conversation
|
|
| ConstItemRhsKind::TypeConst { rhs: Some(anon) } => { | ||
| hir::ConstItemRhs::TypeConst(self.lower_anon_const_to_const_arg_and_alloc(anon)) | ||
| hir::ConstItemRhs::TypeConst(self.arena.alloc( | ||
| match self.can_lower_expr_to_const_arg_direct( | ||
| &anon.value, | ||
| DirectConstArgContext::MacrolessMinGenericConstArgs, | ||
| ) { | ||
| Ok(()) => self.lower_expr_to_const_arg_direct(&anon.value, Some(anon.id)), | ||
| Err(err) => err.emit(self), | ||
| }, | ||
| )) | ||
| } |
There was a problem hiding this comment.
ConstItemRhsKind::TypeConst no longer needs to contain an AnonConst, it can parse identically to the rhs of a regular const, as a normal expr now.
Doing so I've left undone for now, will do so in a followup, it gets a bit more involved (and it's related to this #158617 (comment) that I might do at the same time)
This comment has been minimized.
This comment has been minimized.
925742b to
4e77ce1
Compare
|
This PR changes a file inside |
| } | ||
| ``` | ||
|
|
||
| Using `#![macroless_generic_const_args]` enables you to write the above without the macro: |
There was a problem hiding this comment.
I think this should be #![feature(macroless_generic_const_args)], as shown in the example below.
This comment has been minimized.
This comment has been minimized.
4e77ce1 to
6862ede
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
tracking issue: #159006
lots of description of what is happening here in the tracking issue, not gonna copypaste it into here :)
the test situation is that after discussion with boxy of whether our mgca tests should be:
min_generic_const_args, and adddirect_const_arg!()where it's needed#![feature(macroless_generic_const_args)]where it's neededthe second seems more desirable, so that's what I did. There are still quite a few tests that only have
min_generic_const_argswithoutmacroless_generic_const_args(140 of them, to be exact -rg --files-without-match macroless_generic_const_args $(rg -g '*.rs' --files-with-matches min_generic_const_args tests) | wc -l, and now 90 withmacroless_generic_const_args)r? @BoxyUwU