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

std: eliminate pointless meta.assumeSentinel() usage #14418

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

ifreund
Copy link
Member

@ifreund ifreund commented Jan 22, 2023

This fixes a bug in std.net caused during the introduction of meta.assumeSentinel due to the unfortunate semantics of mem.span()

This leaves only 3 remaining uses of meta.assumeSentinel() in the standard library, each of which could be a simple @ptrCast([*:0]T, foo) instead. I think this function should likely be removed.

See also #14383, #14417

This fixes a bug in std.net caused during the introduction of
meta.assumeSentinel due to the unfortunate semantics of mem.span()

This leaves only 3 remaining uses of meta.assumeSentinel() in the
standard library, each of which could be a simple @ptrCast([*:0]T, foo)
instead. I think this function should likely be removed.
@andrewrk andrewrk merged commit ac28bed into ziglang:master Jan 24, 2023
@andrewrk
Copy link
Member

Thank you. For what it is worth, I am in full support of your crusade against std.meta.assumeSentinel.

@ifreund ifreund deleted the assume-sentinel-sux branch January 24, 2023 10:15
@ifreund
Copy link
Member Author

ifreund commented Jan 24, 2023

#14440

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

Successfully merging this pull request may close these issues.

2 participants