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

Deprecate ONCE_INIT in future 1.38 release #61757

Merged
merged 1 commit into from
Jun 13, 2019

Conversation

sfackler
Copy link
Member

Once::new() has been a stable const fn for a while now.

Closes #61746

@rust-highfive
Copy link
Collaborator

r? @bluss

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 12, 2019
@sfackler
Copy link
Member Author

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned bluss Jun 12, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:07b6d120:start=1560304861869235752,finish=1560304863831939339,duration=1962703587
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:27:47]    Compiling hashbrown v0.4.0
[00:27:50] error: use of deprecated item 'sync::once::ONCE_INIT': the `new` function is now preferred
[00:27:50]    --> src/libstd/sync/mod.rs:166:39
[00:27:50]     |
[00:27:50] 166 | pub use self::once::{Once, OnceState, ONCE_INIT};
[00:27:50]     |
[00:27:50]     = note: `-D deprecated` implied by `-D warnings`
[00:27:50] 
[00:27:52] error: aborting due to previous error

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Centril Centril added this to the 1.37 milestone Jun 12, 2019
@Centril Centril added relnotes Marks issues that should be documented in the release notes of the next release. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jun 12, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:125c8c6b:start=1560312421231393291,finish=1560312423032216239,duration=1800822948
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:40:57]    Compiling rustc_mir v0.0.0 (/checkout/src/librustc_mir)
[00:40:58] error: use of deprecated item 'std::sync::ONCE_INIT': the `new` function is now preferred
[00:40:58]    --> src/librustc_metadata/dynamic_lib.rs:164:38
[00:40:58]     |
[00:40:58] 164 |         use std::sync::{Mutex, Once, ONCE_INIT};
[00:40:58]     |
[00:40:58]     = note: `-D deprecated` implied by `-D warnings`
[00:40:58] 
[00:40:58] error: use of deprecated item 'std::sync::ONCE_INIT': the `new` function is now preferred
[00:40:58] error: use of deprecated item 'std::sync::ONCE_INIT': the `new` function is now preferred
[00:40:58]    --> src/librustc_metadata/dynamic_lib.rs:165:29
[00:40:58]     |
[00:40:58] 165 |         static INIT: Once = ONCE_INIT;
[00:40:58]     |                             ^^^^^^^^^ help: replace the use of the deprecated item: `Once::new()`
[00:41:00] error: aborting due to 2 previous errors
[00:41:00] 
[00:41:01] error: Could not compile `rustc_metadata`.
[00:41:01] warning: build failed, waiting for other jobs to finish...
---
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 1.
travis_time:start:1cc294ee
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Jun 12 04:54:04 UTC 2019
trap-oxgzobynhmm1/s-fd31q2bxq4-1tzpb2u-19ca4iajxr4qm
108532 ./src/llvm-project/lldb
102836 ./.git
98204 ./obj/build/x86_64-unknown-linux-gnu/stage1-std
98060 ./obj/build/x86_64-unknown-linux-gnu/stage0-std

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

r=me w/ ci passing

@sfackler
Copy link
Member Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Jun 12, 2019

📌 Commit d5df2a8 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 12, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 12, 2019
…xcrichton

Deprecate ONCE_INIT

Once::new() has been a stable const fn for a while now.

Closes rust-lang#61746
@Centril
Copy link
Contributor

Centril commented Jun 12, 2019

Failed in #61783 (comment), @bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 12, 2019
Once::new() has been a stable const fn for a while now.

Closes rust-lang#61746
@sfackler
Copy link
Member Author

I pushed the deprecation out one more release to avoid bootstrapping issues with clippy and cargo.

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Jun 13, 2019

📌 Commit 72e99f5 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 13, 2019
@RalfJung RalfJung changed the title Deprecate ONCE_INIT Deprecate ONCE_INIT in future 1.38 release Jun 13, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 13, 2019
…xcrichton

Deprecate ONCE_INIT in future 1.38 release

Once::new() has been a stable const fn for a while now.

Closes rust-lang#61746
bors added a commit that referenced this pull request Jun 13, 2019
Rollup of 5 pull requests

Successful merges:

 - #61598 (Handle index out of bound errors during const eval without panic)
 - #61720 (std: Remove internal definitions of `cfg_if!` macro)
 - #61757 (Deprecate ONCE_INIT in future 1.38 release)
 - #61766 (submodules: update clippy from c0dbd34 to bd33a97)
 - #61791 (Small cleanup in `check_pat_path`)

Failed merges:

r? @ghost
bors added a commit to rust-lang/cargo that referenced this pull request Jun 13, 2019
Deprecated ONCE_INIT in favor of Once::new()

cc rust-lang/rust#61757
@bors bors merged commit 72e99f5 into rust-lang:master Jun 13, 2019
@95th 95th mentioned this pull request Jun 23, 2019
ry pushed a commit to denoland/deno that referenced this pull request Jun 23, 2019
1. Separate Snapshot and Script StartupData functions based on cfg "no-snapshot-init"
2. Replace deprecated Once::ONCE_INIT with Once::new (rust-lang/rust#61757)
3. Elide lifetime
4. Fix typos
Tzikas pushed a commit to Tzikas/squares that referenced this pull request Sep 10, 2019
1. Separate Snapshot and Script StartupData functions based on cfg "no-snapshot-init"
2. Replace deprecated Once::ONCE_INIT with Once::new (rust-lang/rust#61757)
3. Elide lifetime
4. Fix typos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recommend using Once::new() instead of ONCE_INIT?
6 participants