Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Make sets work in const contexts #93

Open
Antikyth opened this issue Jan 24, 2023 · 0 comments
Open

Make sets work in const contexts #93

Antikyth opened this issue Jan 24, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request task An essential task for a planned milestone.

Comments

@Antikyth
Copy link
Collaborator

A lot of the functions in the sets are not const because they use closures to destructure internal representations. It should be possible to achieve the destructuring with the use of const fns though, with no closure, perhaps associated const fns of the internal representation types.

I don't believe it is possible for the builders to work in const contexts yet, unless mutable references are allowed in const fns (link to tracking issue). I feel like in theory they should be able to work - all of the mutations can occur during const evaluation only, and all of the mutable references go out of scope if the build() function is called. The thing that wouldn't work is a const mutable reference at the end of const evaluation (i.e. build() is not called), which feels like it could be something that an error is generated for only if a mutable reference is left over at the end of const evaluation. That's just my intuitive point of view, though, not sure how it works in practice.

@Antikyth Antikyth self-assigned this Jan 24, 2023
@Antikyth Antikyth added task An essential task for a planned milestone. enhancement New feature or request labels Jan 24, 2023
@github-project-automation github-project-automation bot moved this to Unassigned in X Rust Bindings Jan 24, 2023
@Antikyth Antikyth moved this from Unassigned to Assigned in X Rust Bindings Jan 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request task An essential task for a planned milestone.
Projects
Status: Assigned
Development

No branches or pull requests

1 participant