Skip to content

clean up handling of paths in mgca - #160216

Open
khyperia wants to merge 1 commit into
rust-lang:mainfrom
khyperia:gca-path-cleanup
Open

clean up handling of paths in mgca#160216
khyperia wants to merge 1 commit into
rust-lang:mainfrom
khyperia:gca-path-cleanup

Conversation

@khyperia

@khyperia khyperia commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

related tracking issue: #132980

Handling of ambiguous type-or-constant argument paths was really wonky and distinct from the regular can_lower_expr_to_const_arg_direct lowering paths. Clean that up and unify it, as discussed here #158479 (comment)

Also, do a bunch of other little cleanups at the same time while I'm here:

  • add support for parens to the inside of direct_const_arg! and macroless_generic_const_args (idk why this wasn't a thing before)
  • add constant and lifetime ribs when resolving TyKind::DirectConstArg - note the TyKind, not ExprKind (I am unsure if/how this changes behavior added a test, direct-const-arg-correct-rib.rs) - this was discussed here allow mGCA const arguments to fall back to anon consts #158617 (comment)
  • minor debug logging change
  • various minor code shuffles/cleanups
  • add test for direct_const_arg!(_) inferring to a type - this test should have been added in implement #![feature(macroless_generic_const_args)] #159058 which added this behavior (well, changed the behavior from an ICE to inferring to a type)
  • add a test asserting the current behavior of parens/braces/underscores on stable - one or two of these cases already have tests elsewhere, but it's nice to assert the whole set, and also assert the whole set in the same place so it's easily visible to be able to give me confidence the whole set actually is tested (both positives and negatives are important here)
  • add a test similar to the previous one, but with mgca enabled, asserting all combinations now compile successfully

r? @BoxyUwU

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 30, 2026
@rustbot

rustbot commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants