WithOptConstParam
cycle diagramWithout WithOptConstParam
we would get the following cycle:
Using WithOptConstParam
we get the following setup:
While this works, it does get a lot more complex when the anonymous constant contains closures or inline consts. Both of these things are luckily either unstable or not useful.
The issue is that, when calling mir_borrowck
- or some similar query - for the child
, we "forget" the const parameter for constant
by entering a new query. Changing constants and inline constants to also always use WithOptConstParam
to remember the relevant const parameter for their parent seems like quite a lot of effort.
As this isn't a high priority I would prefer to wait for less hacky fix by improving the query system to deal with these cycles.