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

Updated depreciated code. #1448

Closed
wants to merge 2 commits into from
Closed

Conversation

tkreindler
Copy link

Updated a bunch of depreciated code to its modern equivalent.

Notable changes:

  • 0...8 => 0..=8
  • mem::uninitialized() => mem::MaybeUninit::uninit().assume_init()

@ids1024
Copy link
Contributor

ids1024 commented Jan 22, 2020

As I understand it, calling .assume_init() on uninitialized memory is considered undefined behavior. The code needs a further rewrite to avoid this.

Edit: From the documentation:

It is up to the caller to guarantee that the MaybeUninit really is in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior.

@rivy
Copy link
Member

rivy commented Apr 14, 2020

Thanks for the contribution!
The fix for this same issue was already included in a large lint and CICD fixup PR (#1449).
We'd be happy to see you back with new contributions in the future.

@rivy rivy closed this Apr 14, 2020
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.

3 participants