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

Add File::with_options #65429

Merged
merged 2 commits into from
Nov 2, 2019
Merged

Add File::with_options #65429

merged 2 commits into from
Nov 2, 2019

Conversation

Timmmm
Copy link
Contributor

@Timmmm Timmmm commented Oct 15, 2019

This provides a more fluent API to create files with options, and also avoids the need to import OpenOptions.

This implements @aldanor's suggestion which was popular.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @shepmaster (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 15, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-10-15T08:28:11.5604721Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-15T08:28:11.5724344Z ##[command]git config gc.auto 0
2019-10-15T08:28:11.5810020Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-15T08:28:11.5870043Z ##[command]git config --get-all http.proxy
2019-10-15T08:28:11.6059155Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65429/merge:refs/remotes/pull/65429/merge
---
2019-10-15T08:34:23.2059710Z    Compiling serde_json v1.0.40
2019-10-15T08:34:25.1265778Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-10-15T08:34:37.2886500Z     Finished release [optimized] target(s) in 1m 36s
2019-10-15T08:34:37.2968154Z tidy check
2019-10-15T08:34:38.1699769Z tidy error: /checkout/src/libstd/fs.rs:91: trailing whitespace
2019-10-15T08:34:39.5902392Z Found 482 error codes
2019-10-15T08:34:39.5903596Z Found 0 error codes with no tests
2019-10-15T08:34:39.5903783Z Done!
2019-10-15T08:34:39.5904096Z some tidy checks failed
2019-10-15T08:34:39.5904096Z some tidy checks failed
2019-10-15T08:34:39.5904613Z 
2019-10-15T08:34:39.5904937Z 
2019-10-15T08:34:39.5906027Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-10-15T08:34:39.5906270Z 
2019-10-15T08:34:39.5907959Z 
2019-10-15T08:34:39.5919897Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-10-15T08:34:39.5919991Z Build completed unsuccessfully in 0:01:40
2019-10-15T08:34:39.5919991Z Build completed unsuccessfully in 0:01:40
2019-10-15T08:34:39.5970569Z == clock drift check ==
2019-10-15T08:34:39.5984693Z   local time: Tue Oct 15 08:34:39 UTC 2019
2019-10-15T08:34:39.6830788Z   network time: Tue, 15 Oct 2019 08:34:39 GMT
2019-10-15T08:34:39.6833620Z == end clock drift check ==
2019-10-15T08:34:40.4275201Z ##[error]Bash exited with code '1'.
2019-10-15T08:34:40.4322106Z ##[section]Starting: Checkout
2019-10-15T08:34:40.4324664Z ==============================================================================
2019-10-15T08:34:40.4324738Z Task         : Get sources
2019-10-15T08:34:40.4324782Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

src/libstd/fs.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-10-15T10:05:58.8165849Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-15T10:05:58.8282316Z ##[command]git config gc.auto 0
2019-10-15T10:05:58.8360094Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-15T10:05:58.8428512Z ##[command]git config --get-all http.proxy
2019-10-15T10:05:58.8564825Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65429/merge:refs/remotes/pull/65429/merge
---
2019-10-15T10:12:12.6439582Z    Compiling serde_json v1.0.40
2019-10-15T10:12:14.4764614Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-10-15T10:12:26.4029220Z     Finished release [optimized] target(s) in 1m 32s
2019-10-15T10:12:26.4108649Z tidy check
2019-10-15T10:12:27.5127335Z tidy error: /checkout/src/libstd/fs.rs:77: trailing whitespace
2019-10-15T10:12:28.9271492Z Found 482 error codes
2019-10-15T10:12:28.9272529Z Found 0 error codes with no tests
2019-10-15T10:12:28.9272589Z Done!
2019-10-15T10:12:28.9272629Z some tidy checks failed
2019-10-15T10:12:28.9272629Z some tidy checks failed
2019-10-15T10:12:28.9272688Z 
2019-10-15T10:12:28.9272714Z 
2019-10-15T10:12:28.9273514Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-10-15T10:12:28.9273896Z 
2019-10-15T10:12:28.9273922Z 
2019-10-15T10:12:28.9279562Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-10-15T10:12:28.9279658Z Build completed unsuccessfully in 0:01:35
2019-10-15T10:12:28.9279658Z Build completed unsuccessfully in 0:01:35
2019-10-15T10:12:28.9336796Z == clock drift check ==
2019-10-15T10:12:28.9356132Z   local time: Tue Oct 15 10:12:28 UTC 2019
2019-10-15T10:12:29.0213301Z   network time: Tue, 15 Oct 2019 10:12:29 GMT
2019-10-15T10:12:29.0213804Z == end clock drift check ==
2019-10-15T10:12:29.8354832Z ##[error]Bash exited with code '1'.
2019-10-15T10:12:29.8405829Z ##[section]Starting: Checkout
2019-10-15T10:12:29.8408275Z ==============================================================================
2019-10-15T10:12:29.8408340Z Task         : Get sources
2019-10-15T10:12:29.8408388Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

src/libstd/fs.rs Outdated Show resolved Hide resolved
src/libstd/fs.rs Outdated Show resolved Hide resolved
@hellow554
Copy link
Contributor

hellow554 commented Oct 15, 2019 via email

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-10-15T14:42:42.4268132Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-15T14:42:42.4321209Z ##[command]git config gc.auto 0
2019-10-15T14:42:42.4418587Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-15T14:42:42.4490560Z ##[command]git config --get-all http.proxy
2019-10-15T14:42:42.4653981Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65429/merge:refs/remotes/pull/65429/merge
---
2019-10-15T15:46:39.3428784Z .................................................................................................... 1600/9182
2019-10-15T15:46:44.8588501Z .................................................................................................... 1700/9182
2019-10-15T15:46:58.4061692Z ............................i...............i....................................................... 1800/9182
2019-10-15T15:47:06.2491724Z .................................................................................................... 1900/9182
2019-10-15T15:47:21.3286414Z ...................iiiii............................................................................ 2000/9182
2019-10-15T15:47:32.2184999Z .................................................................................................... 2200/9182
2019-10-15T15:47:34.8915288Z .................................................................................................... 2300/9182
2019-10-15T15:47:40.3373196Z .................................................................................................... 2400/9182
2019-10-15T15:48:03.2948882Z .................................................................................................... 2500/9182
---
2019-10-15T15:51:10.0476301Z ...........................i...............i........................................................ 4800/9182
2019-10-15T15:51:22.9516381Z .................................................................................................... 4900/9182
2019-10-15T15:51:29.7397966Z .................................................................................................... 5000/9182
2019-10-15T15:51:39.5067232Z .................................................................................................... 5100/9182
2019-10-15T15:51:47.5738940Z ...........................ii.ii.................................................................... 5200/9182
2019-10-15T15:51:57.7228671Z .................................................................................................... 5400/9182
2019-10-15T15:52:09.2171246Z .............................................................................................i...... 5500/9182
2019-10-15T15:52:17.8965620Z .................................................................................................... 5600/9182
2019-10-15T15:52:23.0432316Z .................................................................................................... 5700/9182
2019-10-15T15:52:23.0432316Z .................................................................................................... 5700/9182
2019-10-15T15:52:34.3219632Z ..........................................................................................ii...i..ii 5800/9182
2019-10-15T15:53:00.8181754Z .................................................................................................... 6000/9182
2019-10-15T15:53:11.1072161Z .................................................................................................... 6100/9182
2019-10-15T15:53:20.7125357Z .................................................................................................i.. 6200/9182
2019-10-15T15:53:35.8781333Z ii.................................................................................................. 6300/9182
---
2019-10-15T15:58:49.9132189Z  finished in 6.095
2019-10-15T15:58:49.9374821Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T15:58:50.1096455Z 
2019-10-15T15:58:50.1097768Z running 153 tests
2019-10-15T15:58:53.5879378Z i....iii......iii..iiii...i.............................i..i..................i....i...........ii.i. 100/153
2019-10-15T15:58:55.7296021Z i..iiii..............i.........iii.i.........ii......
2019-10-15T15:58:55.7298205Z 
2019-10-15T15:58:55.7299893Z  finished in 5.792
2019-10-15T15:58:55.7498193Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T15:58:55.9138479Z 
---
2019-10-15T15:58:58.1645956Z  finished in 2.415
2019-10-15T15:58:58.1875492Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T15:58:58.3590350Z 
2019-10-15T15:58:58.3590986Z running 9 tests
2019-10-15T15:58:58.3592566Z iiiiiiiii
2019-10-15T15:58:58.3593433Z 
2019-10-15T15:58:58.3599980Z  finished in 0.172
2019-10-15T15:58:58.3883364Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T15:58:58.5783480Z 
---
2019-10-15T15:59:17.9075266Z  finished in 19.519
2019-10-15T15:59:17.9311602Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T15:59:18.1137476Z 
2019-10-15T15:59:18.1138336Z running 123 tests
2019-10-15T15:59:45.3078138Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i...ii...i.......ii. 100/123
2019-10-15T15:59:50.3091721Z i.i.i......iii.i.....ii
2019-10-15T15:59:50.3093169Z 
2019-10-15T15:59:50.3093379Z  finished in 32.378
2019-10-15T15:59:50.3105271Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T15:59:50.3107068Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-10-15T16:13:39.9336320Z 
2019-10-15T16:13:39.9340822Z    Doc-tests core
2019-10-15T16:13:45.2838525Z 
2019-10-15T16:13:45.2843071Z running 2405 tests
2019-10-15T16:13:57.6505158Z ......iiiii......................................................................................... 100/2405
2019-10-15T16:14:09.4492066Z ...............................................................................ii................... 200/2405
2019-10-15T16:14:37.4470280Z .i.................................................................................................. 400/2405
2019-10-15T16:14:37.4470280Z .i.................................................................................................. 400/2405
2019-10-15T16:14:49.1851923Z ................................................i..i.................iiii........................... 500/2405
2019-10-15T16:15:11.5870175Z .................................................................................................... 700/2405
2019-10-15T16:15:23.2094309Z .................................................................................................... 800/2405
2019-10-15T16:15:34.6505168Z .................................................................................................... 900/2405
2019-10-15T16:15:46.1752945Z .................................................................................................... 1000/2405
---
2019-10-15T16:20:09.3270620Z ............................................... 300/763
2019-10-15T16:20:09.3300794Z thread '<unnamed>' panicked at 'explicit panic', src/libstd/io/stdio.rs:854:13
2019-10-15T16:20:09.4065323Z .................................................................................................... 400/763
2019-10-15T16:20:11.4871071Z .................................................................................................... 500/763
2019-10-15T16:20:11.5141254Z ....................thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libcore/result.rs:1165:5
2019-10-15T16:20:11.5164538Z ....thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/libcore/result.rs:1165:5
2019-10-15T16:20:11.5173770Z .thread '.<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libcore/result.rs:1165:5
2019-10-15T16:20:11.5221067Z .....thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libcore/result.rs:1165:5
2019-10-15T16:20:11.7760739Z ..........................................thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libcore/result.rs:1165:5
2019-10-15T16:20:11.7808672Z ............thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libcore/result.rs:1165:5
2019-10-15T16:20:11.7922238Z ............... 600/763
2019-10-15T16:20:13.8258333Z ......................thread '<unnamed>' panicked at 'explicit panic', src/libstd/sync/mutex.rs:629:13
2019-10-15T16:20:13.8269055Z ..thread '<unnamed>' panicked at 'test panic in inner thread to poison mutex', src/libstd/sync/mutex.rs:584:13
2019-10-15T16:20:13.8280508Z ...thread '<unnamed>' panicked at 'test panic in inner thread to poison mutex', src/libstd/sync/mutex.rs:561:13
---
2019-10-15T16:20:23.4298086Z 
2019-10-15T16:20:23.4317616Z running 995 tests
2019-10-15T16:20:47.5272970Z i................................................................................................... 100/995
2019-10-15T16:21:00.4298543Z .................................................................................................... 200/995
2019-10-15T16:21:09.7232661Z ...................iii......i......i...i......i..........................................F.......... 300/995
2019-10-15T16:21:16.1462371Z .................................................................................................... 400/995
2019-10-15T16:21:24.7562121Z ......................................i..i.................................ii....................... 500/995
2019-10-15T16:21:41.6102242Z .................................................................................................... 700/995
2019-10-15T16:21:41.6102242Z .................................................................................................... 700/995
2019-10-15T16:21:50.4196209Z .....................iiii........................................................................... 800/995
2019-10-15T16:22:07.4011068Z .................................................................................................... 900/995
2019-10-15T16:22:15.8084275Z ...........................................iiii................................................
2019-10-15T16:22:15.8085314Z 
2019-10-15T16:22:15.8086312Z ---- fs.rs - fs::File::with_options (line 417) stdout ----
2019-10-15T16:22:15.8086861Z error[E0658]: use of unstable library feature 'with_options'
2019-10-15T16:22:15.8087280Z  --> fs.rs:421:17
2019-10-15T16:22:15.8087280Z  --> fs.rs:421:17
2019-10-15T16:22:15.8087467Z   |
2019-10-15T16:22:15.8087693Z 6 |     let mut f = File::with_options().read(true).open("foo.txt")?;
2019-10-15T16:22:15.8088336Z   |
2019-10-15T16:22:15.8088336Z   |
2019-10-15T16:22:15.8089040Z   = note: for more information, see ***/issues/65439
2019-10-15T16:22:15.8089277Z   = help: add `#![feature(with_options)]` to the crate attributes to enable
2019-10-15T16:22:15.8089584Z error: aborting due to previous error
2019-10-15T16:22:15.8089708Z 
2019-10-15T16:22:15.8090152Z For more information about this error, try `rustc --explain E0658`.
2019-10-15T16:22:15.8090592Z Couldn't compile the test.
---
2019-10-15T16:22:15.8194001Z == clock drift check ==
2019-10-15T16:22:15.8209921Z   local time: Tue Oct 15 16:22:15 UTC 2019
2019-10-15T16:22:16.1006154Z   network time: Tue, 15 Oct 2019 16:22:16 GMT
2019-10-15T16:22:16.1018228Z == end clock drift check ==
2019-10-15T16:22:17.3519182Z ##[error]Bash exited with code '1'.
2019-10-15T16:22:17.3572740Z ##[section]Starting: Checkout
2019-10-15T16:22:17.3575110Z ==============================================================================
2019-10-15T16:22:17.3575177Z Task         : Get sources
2019-10-15T16:22:17.3575229Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, 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.
2019-10-15T16:57:35.1712707Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-15T16:57:35.1804152Z ##[command]git config gc.auto 0
2019-10-15T16:57:35.1884953Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-15T16:57:35.1938824Z ##[command]git config --get-all http.proxy
2019-10-15T16:57:35.2094824Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65429/merge:refs/remotes/pull/65429/merge
---
2019-10-15T17:00:21.4857963Z Attempting with retry: docker build --rm -t rust-ci -f /home/vsts/work/1/s/src/ci/docker/mingw-check/Dockerfile /home/vsts/work/1/s/src/ci/docker
2019-10-15T17:00:21.6703609Z Sending build context to Docker daemon  526.3kB
2019-10-15T17:00:21.6704240Z 
2019-10-15T17:00:21.6946229Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:25.1862123Z received unexpected HTTP status: 503 Service Unavailable
2019-10-15T17:00:26.2788583Z Sending build context to Docker daemon  526.3kB
2019-10-15T17:00:26.2789496Z 
2019-10-15T17:00:26.3027128Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:26.3027128Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:26.6353336Z received unexpected HTTP status: 503 Service Unavailable
2019-10-15T17:00:28.7262421Z Sending build context to Docker daemon  526.3kB
2019-10-15T17:00:28.7263528Z 
2019-10-15T17:00:28.7506685Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:28.7506685Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:29.0114079Z received unexpected HTTP status: 503 Service Unavailable
2019-10-15T17:00:32.1030909Z Sending build context to Docker daemon  526.3kB
2019-10-15T17:00:32.1032087Z 
2019-10-15T17:00:32.1311971Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:32.1311971Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:32.4044169Z received unexpected HTTP status: 503 Service Unavailable
2019-10-15T17:00:36.5001369Z Sending build context to Docker daemon  526.3kB
2019-10-15T17:00:36.5001449Z 
2019-10-15T17:00:36.5223116Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:36.5223116Z Step 1/6 : FROM ubuntu:16.04
2019-10-15T17:00:36.8583126Z received unexpected HTTP status: 503 Service Unavailable
2019-10-15T17:00:36.8596631Z The command has failed after 5 attempts.
2019-10-15T17:00:36.8755638Z ##[error]Bash exited with code '1'.
2019-10-15T17:00:36.8793309Z ##[section]Starting: Checkout
2019-10-15T17:00:36.8795315Z ==============================================================================
2019-10-15T17:00:36.8795369Z Task         : Get sources
2019-10-15T17:00:36.8795433Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@hellow554
Copy link
Contributor

hellow554 commented Oct 15, 2019

spurious error? @shepmaster could you trigger the build process again?

or even better: @Timmmm please squash and rebase your commits and then force push them :)

@tesuji
Copy link
Contributor

tesuji commented Oct 15, 2019

This provides a more fluent API to create files with options, and also avoids the need to import OpenOptions.
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-10-15T20:21:03.1488524Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-15T20:21:03.1671675Z ##[command]git config gc.auto 0
2019-10-15T20:21:03.1743964Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-15T20:21:03.1793398Z ##[command]git config --get-all http.proxy
2019-10-15T20:21:03.1932192Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65429/merge:refs/remotes/pull/65429/merge
---
2019-10-15T21:17:20.5952466Z .................................................................................................... 1600/9182
2019-10-15T21:17:25.6887674Z .................................................................................................... 1700/9182
2019-10-15T21:17:38.0159867Z ............................i...............i....................................................... 1800/9182
2019-10-15T21:17:45.2319154Z .................................................................................................... 1900/9182
2019-10-15T21:17:58.9616966Z ...................iiiii............................................................................ 2000/9182
2019-10-15T21:18:08.7487811Z .................................................................................................... 2200/9182
2019-10-15T21:18:11.1177078Z .................................................................................................... 2300/9182
2019-10-15T21:18:16.1428978Z .................................................................................................... 2400/9182
2019-10-15T21:18:37.1156179Z .................................................................................................... 2500/9182
---
2019-10-15T21:21:23.3682644Z ...........................i...............i........................................................ 4800/9182
2019-10-15T21:21:34.4603034Z .................................................................................................... 4900/9182
2019-10-15T21:21:40.5257269Z .................................................................................................... 5000/9182
2019-10-15T21:21:49.2734875Z .................................................................................................... 5100/9182
2019-10-15T21:21:56.6177316Z ...........................ii.ii.................................................................... 5200/9182
2019-10-15T21:22:05.4463176Z .................................................................................................... 5400/9182
2019-10-15T21:22:15.5953465Z .............................................................................................i...... 5500/9182
2019-10-15T21:22:23.3203422Z .................................................................................................... 5600/9182
2019-10-15T21:22:27.7232803Z .................................................................................................... 5700/9182
2019-10-15T21:22:27.7232803Z .................................................................................................... 5700/9182
2019-10-15T21:22:37.9892270Z ..........................................................................................ii...i..ii 5800/9182
2019-10-15T21:23:01.5948103Z .................................................................................................... 6000/9182
2019-10-15T21:23:10.5562879Z .................................................................................................... 6100/9182
2019-10-15T21:23:18.4354780Z .................................................................................................i.. 6200/9182
2019-10-15T21:23:31.9661059Z ii.................................................................................................. 6300/9182
---
2019-10-15T21:28:10.5026288Z  finished in 4.994
2019-10-15T21:28:10.5195258Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T21:28:10.6704083Z 
2019-10-15T21:28:10.6704699Z running 153 tests
2019-10-15T21:28:13.6341743Z i....iii......iii..iiii...i.............................i..i..................i....i...........ii.i. 100/153
2019-10-15T21:28:15.5029197Z i..iiii..............i.........iii.i.........ii......
2019-10-15T21:28:15.5030180Z 
2019-10-15T21:28:15.5034510Z  finished in 4.983
2019-10-15T21:28:15.5206526Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T21:28:15.6724679Z 
---
2019-10-15T21:28:17.5871762Z  finished in 2.066
2019-10-15T21:28:17.6045334Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T21:28:17.7570340Z 
2019-10-15T21:28:17.7570510Z running 9 tests
2019-10-15T21:28:17.7571627Z iiiiiiiii
2019-10-15T21:28:17.7571908Z 
2019-10-15T21:28:17.7571941Z  finished in 0.149
2019-10-15T21:28:17.7718001Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T21:28:17.9236967Z 
---
2019-10-15T21:28:34.6763388Z  finished in 16.904
2019-10-15T21:28:34.6939904Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T21:28:34.8491887Z 
2019-10-15T21:28:34.8492071Z running 123 tests
2019-10-15T21:28:57.2751166Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i...ii...i.......ii. 100/123
2019-10-15T21:29:01.5264681Z i.i.i......iii.i.....ii
2019-10-15T21:29:01.5265937Z 
2019-10-15T21:29:01.5269164Z  finished in 26.833
2019-10-15T21:29:01.5280429Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T21:29:01.5281255Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-10-15T21:41:01.9602267Z 
2019-10-15T21:41:01.9602987Z    Doc-tests core
2019-10-15T21:41:06.9003303Z 
2019-10-15T21:41:06.9004320Z running 2405 tests
2019-10-15T21:41:17.8448413Z ......iiiii......................................................................................... 100/2405
2019-10-15T21:41:28.2291064Z ...............................................................................ii................... 200/2405
2019-10-15T21:41:52.9746847Z .i.................................................................................................. 400/2405
2019-10-15T21:41:52.9746847Z .i.................................................................................................. 400/2405
2019-10-15T21:42:03.1030146Z ................................................i..i.................iiii........................... 500/2405
2019-10-15T21:42:22.6692412Z .................................................................................................... 700/2405
2019-10-15T21:42:32.6014308Z .................................................................................................... 800/2405
2019-10-15T21:42:42.4745878Z .................................................................................................... 900/2405
2019-10-15T21:42:52.3535645Z .................................................................................................... 1000/2405
---
2019-10-15T21:46:51.0841674Z 
2019-10-15T21:46:51.0842463Z running 995 tests
2019-10-15T21:47:10.4344226Z i................................................................................................... 100/995
2019-10-15T21:47:20.8143080Z .................................................................................................... 200/995
2019-10-15T21:47:28.3166372Z ...................iii......i......i...i......i..................................................... 300/995
2019-10-15T21:47:33.4581771Z .................................................................................................... 400/995
2019-10-15T21:47:40.2619533Z ......................................i..i.................................ii....................... 500/995
2019-10-15T21:47:53.6014446Z .................................................................................................... 700/995
2019-10-15T21:47:53.6014446Z .................................................................................................... 700/995
2019-10-15T21:48:00.6991279Z .....................iiii........................................................................... 800/995
2019-10-15T21:48:14.7529714Z .................................................................................................... 900/995
2019-10-15T21:48:21.6994039Z ...........................................iiii................................................
2019-10-15T21:48:21.6996152Z 
2019-10-15T21:48:21.7084873Z  finished in 180.049
2019-10-15T21:48:21.7099215Z Testing term stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-15T21:48:21.8972864Z    Compiling term v0.0.0 (/checkout/src/libterm)
---
2019-10-15T22:01:58.9367086Z     Checking rustc_lsan v0.0.0 (/checkout/src/librustc_lsan)
2019-10-15T22:01:58.9399565Z     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
2019-10-15T22:01:58.9697065Z     Checking hashbrown v0.6.1
2019-10-15T22:01:59.6418365Z  Documenting std v0.0.0 (/checkout/src/libstd)
2019-10-15T22:02:04.0627848Z error: `[std::fs::write]` cannot be resolved, ignoring it...
2019-10-15T22:02:04.0628688Z    --> src/libstd/fs.rs:32:65
2019-10-15T22:02:04.0629038Z     |
2019-10-15T22:02:04.0629662Z 32  | /// Creates a new file and write bytes to it (you can also use [`std::fs::write`]):
2019-10-15T22:02:04.0630529Z     |
2019-10-15T22:02:04.0630973Z note: lint level defined here
2019-10-15T22:02:04.0631474Z    --> src/libstd/lib.rs:211:9
2019-10-15T22:02:04.0632265Z     |
2019-10-15T22:02:04.0632265Z     |
2019-10-15T22:02:04.0632827Z 211 | #![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
2019-10-15T22:02:04.0634066Z     = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
2019-10-15T22:02:04.0634280Z 
2019-10-15T22:02:04.0634280Z 
2019-10-15T22:02:04.0634682Z error: `[std::fs::read]` cannot be resolved, ignoring it...
2019-10-15T22:02:04.0635394Z   --> src/libstd/fs.rs:45:70
2019-10-15T22:02:04.0635741Z    |
2019-10-15T22:02:04.0636149Z 45 | /// Read the contents of a file into a [`String`] (you can also use [`std::fs::read`]):
2019-10-15T22:02:04.0636977Z    |
2019-10-15T22:02:04.0637395Z    = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
2019-10-15T22:02:04.0637537Z 
2019-10-15T22:02:04.3579280Z error: aborting due to 2 previous errors
2019-10-15T22:02:04.3579280Z error: aborting due to 2 previous errors
2019-10-15T22:02:04.3579375Z 
2019-10-15T22:02:04.3974487Z error: Could not document `std`.
2019-10-15T22:02:04.3974580Z 
2019-10-15T22:02:04.3974630Z Caused by:
2019-10-15T22:02:04.3978042Z   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --edition=2018 --crate-type dylib --crate-type rlib --crate-name std src/libstd/lib.rs --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc --cfg 'feature="backtrace"' --cfg 'feature="compiler-builtins-c"' --cfg 'feature="default"' --cfg 'feature="panic_unwind"' --cfg 'feature="std_detect_dlsym_getauxval"' --cfg 'feature="std_detect_file_io"' --color always --markdown-css rust.css --markdown-no-toc --generate-redirect-pages --resource-suffix 1.40.0 --index-page /checkout/src/doc/index.md -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/release/deps --extern alloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liballoc-3551d60d1d65c68a.rmeta --extern backtrace_rs=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libbacktrace-2937c7e63d68f3b1.rmeta --extern cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcfg_if-942928a82284b8e4.rmeta --extern compiler_builtins=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcompiler_builtins-3a009331d0964bed.rmeta --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-67faf12ddd846db2.rmeta --extern hashbrown=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libhashbrown-d66f4f2f54eece34.rmeta --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/liblibc-c1a3cc2ad9e0a1c3.rmeta --extern panic_abort=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libpanic_abort-7c8d78f989a1a1ce.rmeta --extern panic_unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libpanic_unwind-1d2173391b029d77.rmeta --extern rustc_asan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_asan-3152adc362a03acb.rmeta --extern rustc_lsan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_lsan-0725c4ee8cd1fcb5.rmeta --extern rustc_msan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_msan-5f5dfedc27dfc645.rmeta --extern rustc_tsan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/librustc_tsan-60d8f5dbea090760.rmeta --extern unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libunwind-1d9f57a3c7d844c7.rmeta` (exit code: 1)
2019-10-15T22:02:04.3993059Z 
2019-10-15T22:02:04.3993059Z 
2019-10-15T22:02:04.3994585Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustdoc" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-Z" "unstable-options" "-p" "std" "--" "--markdown-css" "rust.css" "--markdown-no-toc" "--generate-redirect-pages" "--resource-suffix" "1.40.0" "--index-page" "/checkout/src/doc/index.md"
2019-10-15T22:02:04.3994750Z 
2019-10-15T22:02:04.3994782Z 
2019-10-15T22:02:04.3999419Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-10-15T22:02:04.3999476Z Build completed unsuccessfully in 1:33:54
2019-10-15T22:02:04.3999476Z Build completed unsuccessfully in 1:33:54
2019-10-15T22:02:04.4049318Z == clock drift check ==
2019-10-15T22:02:04.4067525Z   local time: Tue Oct 15 22:02:04 UTC 2019
2019-10-15T22:02:04.6846998Z   network time: Tue, 15 Oct 2019 22:02:04 GMT
2019-10-15T22:02:04.6847069Z == end clock drift check ==
2019-10-15T22:02:09.9345860Z ##[error]Bash exited with code '1'.
2019-10-15T22:02:09.9385310Z ##[section]Starting: Checkout
2019-10-15T22:02:09.9387018Z ==============================================================================
2019-10-15T22:02:09.9387070Z Task         : Get sources
2019-10-15T22:02:09.9387105Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@hellow554
Copy link
Contributor

@timmm are you able to fix that or do you need help? (hint: take a look at

rust/src/libstd/fs.rs

Lines 97 to 105 in f54911c

/// Metadata information about a file.
///
/// This structure is returned from the [`metadata`] or
/// [`symlink_metadata`] function or method and represents known
/// metadata about a file such as its permissions, size, modification
/// times, etc.
///
/// [`metadata`]: fn.metadata.html
/// [`symlink_metadata`]: fn.symlink_metadata.html
)

@Timmmm
Copy link
Contributor Author

Timmmm commented Oct 16, 2019

At last :-D Sorry for using the CI system as my build tool... Next time I will compile it myself!

@JohnCSimon
Copy link
Member

Ping from triage:

@shepmaster Can you please review this PR? Thanks
CC: @Timmmm

@JohnCSimon
Copy link
Member

Pinging again from triage:

@shepmaster Can you please review this PR? Thanks
CC: @Timmmm @hellow554

@Mark-Simulacrum
Copy link
Member

r? @Mark-Simulacrum

@bors r+

Seems like some libs folks were in favor of this on the associated RFC so we can probably move ahead here (it's an unstable feature anyway).

@bors
Copy link
Contributor

bors commented Nov 2, 2019

📌 Commit c8150cb has been approved by Mark-Simulacrum

@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 Nov 2, 2019
@@ -397,6 +399,37 @@ impl File {
OpenOptions::new().write(true).create(true).truncate(true).open(path.as_ref())
}

/// Returns a new OpenOptions object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add link for this

Suggested change
/// Returns a new OpenOptions object.
/// Returns a new [OpenOptions] object.

/// open or create a file with specific options if `open()` or `create()`
/// are not appropriate.
///
/// It is equivalent to `OpenOptions::new()` but allows you to write more
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// It is equivalent to `OpenOptions::new()` but allows you to write more
/// It is equivalent to [`OpenOptions::new()`] but allows you to write more

/// you can write `File::with_options().read(true).open("foo.txt"). This
/// also avoids the need to import `OpenOptions`.
///
/// See the [`OpenOptions::new`] function for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// See the [`OpenOptions::new`] function for more details.

Comment on lines +404 to +406
/// This function returns a new OpenOptions object that you can use to
/// open or create a file with specific options if `open()` or `create()`
/// are not appropriate.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove theses lines.

@bors
Copy link
Contributor

bors commented Nov 2, 2019

⌛ Testing commit c8150cb with merge 91fd628...

bors added a commit that referenced this pull request Nov 2, 2019
Add File::with_options

This provides a more fluent API to create files with options, and also avoids the need to import OpenOptions.

This implements @aldanor's [suggestion](rust-lang/rfcs#2615 (comment)) which was popular.
@bors
Copy link
Contributor

bors commented Nov 2, 2019

☀️ Test successful - checks-azure
Approved by: Mark-Simulacrum
Pushing 91fd628 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 2, 2019
@bors bors merged commit c8150cb into rust-lang:master Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants