Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Removing unused lookup entries during compilation #202

Open
mainrs opened this issue Mar 3, 2021 · 1 comment
Open

Question: Removing unused lookup entries during compilation #202

mainrs opened this issue Mar 3, 2021 · 1 comment
Labels
blocked-on-upstream the progress is blocked on upstream

Comments

@mainrs
Copy link

mainrs commented Mar 3, 2021

Is it possible to remove unused lookup tables if the lookups are known at compile time? For example, if I have a map full of values but a user of a library only needs one or two values out of it.

I am not sure if Rust is capable of doing this. I think storing the return type inside a const variable would do the trick, as it would move the data into the user's application, but that would mean that get had to be const as well.

@abonander
Copy link
Collaborator

While this is certainly conceivable within the context of const fn, it would require impl const Trait: rust-lang/rfcs#2632

@JohnTitor JohnTitor added the blocked-on-upstream the progress is blocked on upstream label Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-on-upstream the progress is blocked on upstream
Projects
None yet
Development

No branches or pull requests

3 participants