Skip to content

Proposal: allow Fut: ?Sized in Shared<Fut> #2623

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

Closed
TennyZhuang opened this issue Jul 15, 2022 · 1 comment
Closed

Proposal: allow Fut: ?Sized in Shared<Fut> #2623

TennyZhuang opened this issue Jul 15, 2022 · 1 comment

Comments

@TennyZhuang
Copy link
Contributor

No description provided.

@taiki-e
Copy link
Member

taiki-e commented Jul 15, 2022

This is not possible in the current implementation because we are using enums to reduce memory usage. we could implement this by splitting the enum into multiple fields, but we prefer not to do it because it would increase memory usage. If the enum or union supports unsized values, this can be supported (rfcs: rust-lang/rfcs#1151, rust-lang/rfcs#3041).

enum FutureOrOutput<Fut: Future> {
Future(Fut),
Output(Fut::Output),
}

@taiki-e taiki-e closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants