Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
repr(tag = ...)
for type aliases #3659base: master
Are you sure you want to change the base?
repr(tag = ...)
for type aliases #3659Changes from 1 commit
9da95c4
2ce777c
4975077
3302274
d20d743
07c2d94
b123535
9b22aba
b71923a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
type u32 = u8
seems needlessly obfuscating; I think it'd be a more readable example to writetype C = u8
and then#[repr(type = C)]
, which is equivalent to#[repr(u8)]
rather than$[repr(C)]
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that I was intentionally pointing out the obfuscation here because it feels more likely:
#[repr(type = C)]
is obviously going to mean whateverC
type you have, but#[repr(type = u32)]
meaning#[repr(u8)]
is more likely to occur in something like proc macros if someone is doing something nefarious. So, genuinely, there is a preference to do#[repr(u32)]
over#[repr(type = u32)]
when you don't necessarily trust the parent scope.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've since updated this section a bit to elaborate a bit better, including what a type alias
C
might look like. Does this feel like it addresses your concerns?