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

?Sized fields #11

Open
nikomatsakis opened this issue May 25, 2017 · 0 comments
Open

?Sized fields #11

nikomatsakis opened this issue May 25, 2017 · 0 comments

Comments

@nikomatsakis
Copy link
Owner

@glaebhoerl points out that it might make sense to allow fields of "DST" type. They give some examples:

E.g. given a trait HasBytes with an associated field bytes: [u8], I could imagine impls of it for particular structs mapping it onto any of:
(a) a fixed-size array my_field: [u8; 666],
(b) a single my_field: u8,
(c) an empty array [], for example if the struct doesn't even contain any u8s,
(d) a dynamically-sized array my_field: [u8].

and indeed, this all makes sense. But it might be something to defer for a follow-up RFC or for the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant