Repository navigation
#[derive(FromBytes)] not checked for generic structs? #2150
Closed
peter-lyons-kehl
started this conversation in
General
Replies: 3 comments
|
I'm also perplexed that it fails even without the |
0 replies
|
I think your confusion stems from Rust's odd treatment of type aliases: they're essentially unchecked at the definition site. For example, this produces no error at all: struct Wrapper<T: Sized>(T);
type UnsizedWrapper = Wrapper<[u8]>;...until you actually use the alias; e.g., this: impl UnsizedWrapper {}...results in an error: |
0 replies
|
Wow, thank you. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi. I must be missing something obvious, but I can't believe that the following compiles (both with
1.85.0-nightlyand1.83.0stable (installed withrustupon current x64 Manjaro Linux). Any tips, please?Cargo.tomlcontains:https://docs.rs/zerocopy/latest/zerocopy/derive.FromZeros.html doesn't mention anything about generics.
All reactions