I think itās worth spelling out whatās going on here. In my view, itās part of the natural transition from āproblem orientationā to āsolution orientationā.
On the one hand, youāre absolutely right: solving the problem you mention is very much in scope, and should be part of the overall initiative.
On the other hand, when it comes to design, thereās a danger of āscenario solvingā: designing a feature too specifically to a particular use case. That can lead to global designs that donāt scale well, or have lots of inconsistencies.
So, when we set out to solve a problem like āallowing owned values where references are expectedā, we need to simultaneously keep our eye on the prize ā the full set of problems we want to solve ā and yet make sure the design we do fits into the broader context of the language.
What people have realized on this thread is that we can:
- Extend the applicability of coercions, so that they are applied when working with functions or closures as well.
- Extend the set of coercions to include
AsRef.
These two things together solve the original problem. But two separate pieces of design are involved ā and in particular, the key is that we want (1) to be applicable to all coercions, not just AsRef coercions. We set out to solve one particular, narrow problem, but found that part of our solution can actually apply to a much broader range of problems, i.e. to all kinds of coercions that you want to apply at the function/closure level.
Of course, in the end we do need to make sure that we land designs for (1) and (2) such that we solve the original problem; theyāre not entirely orthogonal. And thatās just how the design process goes: from local to global and back, iterating until you get somewhere that solves a satisfactory set of specific problems while extending the language in a globally coherent way.