-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Milestone
Description
We've let the matter of box
slip too long. Nobody is happy with its current state, I think, but the final direction is perhaps not quite clear.
Some problems are:
- The syntax
box(place) expr
is ambiguous.in(place) expr
has been proposed as an alternative. - Having
box expr
be tied toBox<T>
is not great. Using inference has been proposed as an alternative. - The protocol should be extensible. @pnkfelix has a proposal but there has been some pushback that the protocol might be cleaner given hypothetical future language features.
Options I see:
- Feature-gate box completely for now, adding a
Box::new
function. - Implement the protocol @pnkfelix designed, but declare it unstable. The idea is to prevent people from implementing the protocol themselves or using it directly. This is similar to what we are doing for the
Fn
traits. - Implement the protocol @pnkfelix designed and commit to it.
The actual path we want to take can be a combination of the above options. i.e., we might feature-gate for now, but do option 2 during beta period.
I think that whatever we do, we should ensure that we do not ship with box(foo) expr
permitted in stable code.
Metadata
Metadata
Assignees
Labels
No labels