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

Update to mem::MaybeUninit and Once::new() #1230

Closed
wants to merge 1 commit into from

Conversation

nipunn1313
Copy link
Contributor

Newest version of rust compiler warns about deprecation for mem::uninitialized and ONCE_INIT - prefers these versions. I confirmed this compiles on the latest stable as well as the latest nightly.

Newest version of rust compiler does not like mem::uninitialized
and ONCE_INIT - prefers these versions.

Bump minimum version to 1.36.0
@sfackler
Copy link
Owner

sfackler commented Feb 9, 2020

I'd rather not bump the minimum supported rust version for internal-only changes like this.

@nipunn1313
Copy link
Contributor Author

Yep - I was just going to ask about that. Would it be worth throwing cfg[feature(maybe_uninit)] around it ?rust-lang/rust#63566?

@nipunn1313
Copy link
Contributor Author

nipunn1313 commented Feb 10, 2020

The reason this came up is because on the latest nightly - the warnings for openssl come up every time we compile our crates (even if rust-openssl didn't require a recompile) - so they tend to block up the screen.

eg

warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
   --> /home/nipunn/src/client/rust_patched_vendor/rust-openssl/openssl/src/sha.rs:285:38
    |
285 |             let mut hash: [u8; 64] = mem::uninitialized();

@nipunn1313 nipunn1313 closed this Feb 10, 2020
@nipunn1313 nipunn1313 reopened this Feb 10, 2020
@nipunn1313
Copy link
Contributor Author

see rust-lang/cargo#7450 for context

@sfackler
Copy link
Owner

Sticking #[allow(deprecated)] on the offending functions seems reasonable.

@nipunn1313
Copy link
Contributor Author

Put up 1231 to take that approach. This can be revived eventually whenever you would like to bump the min supported rust version.

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