#[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 |
Beta Was this translation helpful? Give feedback.
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:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Wow, thank you. |
Beta Was this translation helpful? Give feedback.
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-nightly
and1.83.0
stable (installed withrustup
on current x64 Manjaro Linux). Any tips, please?Cargo.toml
contains:https://docs.rs/zerocopy/latest/zerocopy/derive.FromZeros.html doesn't mention anything about generics.
Beta Was this translation helpful? Give feedback.
All reactions