Post #2218780
2026-02-15 06:46 UTC
@roguelazer@hachyderm.io so, I actually was thinking after submitting that maybe there'd be more uses of non-const defaults for fn params than for field defaults (where the RFC was accepted with the same restriction). But if this were to be done with the restriction, I think it should work the same way, which I think is equivalent to supplying a named const or const block as the argument (maybe what you meant by cloning on every invocation, though the Clone trait is not involved).
Replies (1)
-
@jplatte@social.tchncs.de 2026-02-15 06:48
@roguelazer@hachyderm.io so, generic parameters of the function would be in scope, but nothing else that's not also in scope at the fn decl level. Nothing would be different whether the fn was const or not.