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 Result::cloned{,_err} and Result::copied{,_err} #63166

Merged
merged 7 commits into from
Sep 4, 2019
Merged

Add Result::cloned{,_err} and Result::copied{,_err} #63166

merged 7 commits into from
Sep 4, 2019

Conversation

ksqsf
Copy link
Contributor

@ksqsf ksqsf commented Jul 31, 2019

This is a little nice addition to Result.

  1. I'm not sure how useful are cloned_err and copied_err, but for the sake of completeness they are here.
  2. Naming is similar to map/map_err. I thought about naming cloned as cloned_ok and add another method called cloned that clones both Ok and Err, but cloned_ok should be more prevalent than cloned_both.

@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 @sfackler (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 Jul 31, 2019
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

/// assert_eq!(copied, Ok(12));
/// ```
#[unstable(feature = "result_copied", reason = "newly added", issue = "63168")]
pub fn copied(self) -> Result<T, E> {
Copy link
Contributor

Choose a reason for hiding this comment

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

My gut tells me that this should be called copied_ok so that there can be a copied that will copy both sides in one go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure about the usefulness. From my experience, I usually only need copied_ok and cloned_ok. But indeed having copied, copied_ok, and copied_err is more consistent. I've added them in the update.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (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-07-31T18:47:42.2571873Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-31T18:47:42.2774953Z ##[command]git config gc.auto 0
2019-07-31T18:47:42.2843403Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-31T18:47:42.2899618Z ##[command]git config --get-all http.proxy
2019-07-31T18:47:42.3029504Z ##[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/63166/merge:refs/remotes/pull/63166/merge
---
2019-07-31T18:48:16.5760686Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-31T18:48:16.5760727Z 
2019-07-31T18:48:16.5761219Z   git checkout -b <new-branch-name>
2019-07-31T18:48:16.5761284Z 
2019-07-31T18:48:16.5761334Z HEAD is now at 714cdff09 Merge 6c130817623426697d8ebdf5d505487bd11ee2f6 into 9152fe4ea053a29469691349f4b63aa94c9aac56
2019-07-31T18:48:16.5913924Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-31T18:48:16.5916298Z ==============================================================================
2019-07-31T18:48:16.5916344Z Task         : Bash
2019-07-31T18:48:16.5916380Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-31T19:49:14.9977886Z .................................................................................................... 1400/8819
2019-07-31T19:49:20.6443067Z .................................................................................................... 1500/8819
2019-07-31T19:49:33.1012667Z .................................................................i...............i.................. 1600/8819
2019-07-31T19:49:40.3542524Z .................................................................................................... 1700/8819
2019-07-31T19:49:54.8937336Z ...................................................iiiii............................................ 1800/8819
2019-07-31T19:50:05.7187563Z .................................................................................................... 2000/8819
2019-07-31T19:50:08.1683773Z .................................................................................................... 2100/8819
2019-07-31T19:50:11.6958566Z .................................................................................................... 2200/8819
2019-07-31T19:50:18.0626033Z .................................................................................................... 2300/8819
---
2019-07-31T19:54:05.0642985Z .................................................................................................... 5300/8819
2019-07-31T19:54:12.2110609Z ..............i..................................................................................... 5400/8819
2019-07-31T19:54:17.6322891Z .................................................................................................... 5500/8819
2019-07-31T19:54:29.5304629Z .................................................................................................... 5600/8819
2019-07-31T19:54:42.9944272Z ........ii...i..ii...........i...................................................................... 5700/8819
2019-07-31T19:54:59.2612759Z .................................................................................................... 5900/8819
2019-07-31T19:55:03.8581518Z .................................................................................................... 6000/8819
2019-07-31T19:55:03.8581518Z .................................................................................................... 6000/8819
2019-07-31T19:55:17.4089758Z ........i..ii....................................................................................... 6100/8819
2019-07-31T19:55:36.0588040Z ...................................................i................................................ 6300/8819
2019-07-31T19:55:38.1927036Z .................................................................................................... 6400/8819
2019-07-31T19:55:40.5284580Z .....................i.............................................................................. 6500/8819
2019-07-31T19:55:44.9502924Z .................................................................................................... 6600/8819
---
2019-07-31T20:00:15.5728670Z  finished in 20.292
2019-07-31T20:00:15.5729049Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-07-31T20:00:15.5729190Z 
2019-07-31T20:00:15.5729336Z running 146 tests
2019-07-31T20:00:18.3204295Z i....iii......iii..iiii....i............................i..i................i....i.........ii.i.i..i 100/146
2019-07-31T20:00:20.1294419Z iii..............i.........iii.i......ii......
2019-07-31T20:00:20.1295123Z 
2019-07-31T20:00:20.1295202Z  finished in 5.147
2019-07-31T20:00:20.1468612Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-07-31T20:00:20.3015564Z 
---
2019-07-31T20:00:22.3562345Z  finished in 2.209
2019-07-31T20:00:22.3753371Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-07-31T20:00:22.5283376Z 
2019-07-31T20:00:22.5283647Z running 9 tests
2019-07-31T20:00:22.5284349Z iiiiiiiii
2019-07-31T20:00:22.5284806Z 
2019-07-31T20:00:22.5284847Z  finished in 0.153
2019-07-31T20:00:22.5474278Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-07-31T20:00:22.7048033Z 
---
2019-07-31T20:00:40.6491792Z  finished in 18.102
2019-07-31T20:00:40.6676374Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-07-31T20:00:40.8250581Z 
2019-07-31T20:00:40.8251511Z running 122 tests
2019-07-31T20:01:03.7227220Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
2019-07-31T20:01:08.1868711Z .i.i......iii.i.....ii
2019-07-31T20:01:08.1873531Z 
2019-07-31T20:01:08.1873611Z  finished in 27.519
2019-07-31T20:01:08.1882110Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-07-31T20:01:08.1882620Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-07-31T20:14:44.0471558Z 
2019-07-31T20:14:44.0478808Z    Doc-tests core
2019-07-31T20:14:48.2162767Z 
2019-07-31T20:14:48.2169595Z running 2395 tests
2019-07-31T20:15:01.0417862Z ......iiiii......................................................................................... 100/2395
2019-07-31T20:15:13.1796406Z .........................................................................ii......................... 200/2395
2019-07-31T20:15:41.3361906Z .................................................................................................... 400/2395
2019-07-31T20:15:41.3361906Z .................................................................................................... 400/2395
2019-07-31T20:15:51.9971601Z ..............................i..i.................iiii............................................. 500/2395
2019-07-31T20:16:14.3227201Z .................................................................................................... 700/2395
2019-07-31T20:16:26.9847824Z .................................................................................................... 800/2395
2019-07-31T20:16:39.6416757Z .................................................................................................... 900/2395
2019-07-31T20:16:52.3179164Z .................................................................................................... 1000/2395
---
2019-07-31T20:18:19.0685630Z .................................................................................................... 1700/2395
2019-07-31T20:18:31.5505683Z .................................................................................................... 1800/2395
2019-07-31T20:18:44.4213388Z .................................................................................................... 1900/2395
2019-07-31T20:18:58.8450700Z .................................................................................................... 2000/2395
2019-07-31T20:19:10.6447549Z ..............................................................................................F.FFFF 2100/2395
2019-07-31T20:19:24.8296763Z FFFFFFFF.FFF........................................................................................ 2200/2395
2019-07-31T20:19:55.7428035Z ....i..........................................................................................
2019-07-31T20:19:55.7428875Z failures:
2019-07-31T20:19:55.7429545Z 
2019-07-31T20:19:55.7429545Z 
2019-07-31T20:19:55.7430863Z ---- result.rs - result::Result<&'_ T, &'_ E>::cloned (line 1057) stdout ----
2019-07-31T20:19:55.7431207Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7431940Z   |
2019-07-31T20:19:55.7431940Z   |
2019-07-31T20:19:55.7432182Z 5 | assert_eq!(Err(&1).cloned(), Err(1));
2019-07-31T20:19:55.7432390Z   |                    ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7432595Z   |
2019-07-31T20:19:55.7432832Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7433050Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7433289Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7433666Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7434310Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7434780Z  --> result.rs:1060:20
2019-07-31T20:19:55.7435044Z   |
2019-07-31T20:19:55.7435044Z   |
2019-07-31T20:19:55.7435963Z 6 | assert_eq!(Ok(&42).cloned(), Ok(42));
2019-07-31T20:19:55.7436252Z   |                    ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7436467Z   |
2019-07-31T20:19:55.7436714Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7436936Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7437179Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7437411Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7437838Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7438031Z 
2019-07-31T20:19:55.7438554Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7439223Z Couldn't compile the test.
2019-07-31T20:19:55.7439223Z Couldn't compile the test.
2019-07-31T20:19:55.7440114Z ---- result.rs - result::Result<&'_ T, &'_ mut E>::cloned (line 1091) stdout ----
2019-07-31T20:19:55.7440431Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7441126Z   |
2019-07-31T20:19:55.7441126Z   |
2019-07-31T20:19:55.7441329Z 5 | assert_eq!(Err(&mut 1).cloned(), Err(1));
2019-07-31T20:19:55.7441554Z   |                        ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7441752Z   |
2019-07-31T20:19:55.7441984Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7442217Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7442429Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7442670Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7443072Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7443498Z  --> result.rs:1094:20
2019-07-31T20:19:55.7443756Z   |
2019-07-31T20:19:55.7443756Z   |
2019-07-31T20:19:55.7443961Z 6 | assert_eq!(Ok(&42).cloned(), Ok(42));
2019-07-31T20:19:55.7444181Z   |                    ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7444380Z   |
2019-07-31T20:19:55.7444583Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7444810Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7445018Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7445228Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7446118Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7446328Z 
2019-07-31T20:19:55.7446858Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7447562Z Couldn't compile the test.
2019-07-31T20:19:55.7447562Z Couldn't compile the test.
2019-07-31T20:19:55.7448104Z ---- result.rs - result::Result<&'_ T, &'_ E>::copied (line 909) stdout ----
2019-07-31T20:19:55.7448837Z  --> result.rs:911:1
2019-07-31T20:19:55.7449262Z   |
2019-07-31T20:19:55.7449262Z   |
2019-07-31T20:19:55.7449486Z 5 | assert_eq!(Err(&1), Err(1));
2019-07-31T20:19:55.7450065Z   | |
2019-07-31T20:19:55.7450065Z   | |
2019-07-31T20:19:55.7450291Z   | expected &{integer}, found integer
2019-07-31T20:19:55.7450509Z   | help: try using a variant of the expected type: `Ok(*right_val)`
2019-07-31T20:19:55.7450732Z   |
2019-07-31T20:19:55.7451098Z   = note: expected type `std::result::Result<_, &{integer}>`
2019-07-31T20:19:55.7451304Z              found type `std::result::Result<_, {integer}>`
2019-07-31T20:19:55.7452252Z 
2019-07-31T20:19:55.7452477Z error[E0308]: mismatched types
2019-07-31T20:19:55.7452931Z  --> result.rs:912:1
2019-07-31T20:19:55.7453190Z   |
2019-07-31T20:19:55.7453190Z   |
2019-07-31T20:19:55.7453392Z 6 | assert_eq!(Ok(&42), Ok(42));
2019-07-31T20:19:55.7453811Z   | |
2019-07-31T20:19:55.7453811Z   | |
2019-07-31T20:19:55.7454007Z   | expected &{integer}, found integer
2019-07-31T20:19:55.7454234Z   | help: try using a variant of the expected type: `Err(*right_val)`
2019-07-31T20:19:55.7454432Z   |
2019-07-31T20:19:55.7455180Z   = note: expected type `std::result::Result<&{integer}, _>`
2019-07-31T20:19:55.7455423Z              found type `std::result::Result<{integer}, _>`
2019-07-31T20:19:55.7456618Z 
2019-07-31T20:19:55.7456810Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7456946Z 
2019-07-31T20:19:55.7457341Z For more information about this error, try `rustc --explain E0308`.
2019-07-31T20:19:55.7457341Z For more information about this error, try `rustc --explain E0308`.
2019-07-31T20:19:55.7457732Z Couldn't compile the test.
2019-07-31T20:19:55.7458134Z ---- result.rs - result::Result<&'_ T, E>::cloned_ok (line 977) stdout ----
2019-07-31T20:19:55.7458313Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7458841Z   |
2019-07-31T20:19:55.7459162Z 8 | let cloned = x.cloned();
2019-07-31T20:19:55.7459302Z   |                ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7459430Z   |
2019-07-31T20:19:55.7459430Z   |
2019-07-31T20:19:55.7459693Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7459846Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7459997Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7460166Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7460425Z error: aborting due to previous error
2019-07-31T20:19:55.7460558Z 
2019-07-31T20:19:55.7460931Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7461449Z Couldn't compile the test.
2019-07-31T20:19:55.7461449Z Couldn't compile the test.
2019-07-31T20:19:55.7461868Z ---- result.rs - result::Result<&'_ T, &'_ mut E>::copied (line 943) stdout ----
2019-07-31T20:19:55.7462651Z  --> result.rs:945:1
2019-07-31T20:19:55.7462857Z   |
2019-07-31T20:19:55.7462857Z   |
2019-07-31T20:19:55.7462997Z 5 | assert_eq!(Err(&mut 1), Err(1));
2019-07-31T20:19:55.7463297Z   | |
2019-07-31T20:19:55.7463439Z   | expected mutable reference, found integer
2019-07-31T20:19:55.7463439Z   | expected mutable reference, found integer
2019-07-31T20:19:55.7463605Z   | help: try using a variant of the expected type: `Ok(*right_val)`
2019-07-31T20:19:55.7463761Z   |
2019-07-31T20:19:55.7463909Z   = note: expected type `std::result::Result<_, &mut {integer}>`
2019-07-31T20:19:55.7464246Z              found type `std::result::Result<_, {integer}>`
2019-07-31T20:19:55.7464904Z 
2019-07-31T20:19:55.7465064Z error[E0308]: mismatched types
2019-07-31T20:19:55.7465396Z  --> result.rs:946:1
2019-07-31T20:19:55.7466361Z   |
2019-07-31T20:19:55.7466361Z   |
2019-07-31T20:19:55.7466530Z 6 | assert_eq!(Ok(&42), Ok(42));
2019-07-31T20:19:55.7466814Z   | |
2019-07-31T20:19:55.7466814Z   | |
2019-07-31T20:19:55.7466975Z   | expected &{integer}, found integer
2019-07-31T20:19:55.7467147Z   | help: try using a variant of the expected type: `Err(*right_val)`
2019-07-31T20:19:55.7467290Z   |
2019-07-31T20:19:55.7467457Z   = note: expected type `std::result::Result<&{integer}, _>`
2019-07-31T20:19:55.7467717Z              found type `std::result::Result<{integer}, _>`
2019-07-31T20:19:55.7468468Z 
2019-07-31T20:19:55.7468611Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7468733Z 
2019-07-31T20:19:55.7469130Z For more information about this error, try `rustc --explain E0308`.
2019-07-31T20:19:55.7469130Z For more information about this error, try `rustc --explain E0308`.
2019-07-31T20:19:55.7469644Z Couldn't compile the test.
2019-07-31T20:19:55.7470042Z ---- result.rs - result::Result<&'_ mut T, &'_ E>::cloned (line 1074) stdout ----
2019-07-31T20:19:55.7470238Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7470743Z   |
2019-07-31T20:19:55.7470743Z   |
2019-07-31T20:19:55.7470879Z 5 | assert_eq!(Err(&1).cloned(), Err(1));
2019-07-31T20:19:55.7471019Z   |                    ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7471172Z   |
2019-07-31T20:19:55.7471328Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7471492Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7471665Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7471812Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7472093Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7472420Z  --> result.rs:1077:24
2019-07-31T20:19:55.7472584Z   |
2019-07-31T20:19:55.7472584Z   |
2019-07-31T20:19:55.7472744Z 6 | assert_eq!(Ok(&mut 42).cloned(), Ok(42));
2019-07-31T20:19:55.7472886Z   |                        ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7473038Z   |
2019-07-31T20:19:55.7473182Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7473339Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7473514Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7473666Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7473939Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7474060Z 
2019-07-31T20:19:55.7474425Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7474791Z Couldn't compile the test.
2019-07-31T20:19:55.7474791Z Couldn't compile the test.
2019-07-31T20:19:55.7475184Z ---- result.rs - result::Result<&'_ T, E>::copied_ok (line 829) stdout ----
2019-07-31T20:19:55.7475355Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7476417Z   |
2019-07-31T20:19:55.7476417Z   |
2019-07-31T20:19:55.7476558Z 8 | let copied = x.copied();
2019-07-31T20:19:55.7476725Z   |                ^^^^^^ multiple `copied` found
2019-07-31T20:19:55.7476885Z   |
2019-07-31T20:19:55.7477042Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7477363Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7477518Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7477686Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7477954Z error: aborting due to previous error
2019-07-31T20:19:55.7478073Z 
2019-07-31T20:19:55.7478501Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7478871Z Couldn't compile the test.
2019-07-31T20:19:55.7478871Z Couldn't compile the test.
2019-07-31T20:19:55.7479481Z ---- result.rs - result::Result<&'_ mut T, &'_ mut E>::cloned (line 1108) stdout ----
2019-07-31T20:19:55.7479681Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7480593Z   |
2019-07-31T20:19:55.7480593Z   |
2019-07-31T20:19:55.7480776Z 5 | assert_eq!(Err(&mut 1).cloned(), Err(1));
2019-07-31T20:19:55.7480958Z   |                        ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7481109Z   |
2019-07-31T20:19:55.7481337Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7481494Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7481640Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7481806Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7482089Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7482455Z  --> result.rs:1111:24
2019-07-31T20:19:55.7482628Z   |
2019-07-31T20:19:55.7482628Z   |
2019-07-31T20:19:55.7482762Z 6 | assert_eq!(Ok(&mut 42).cloned(), Ok(42));
2019-07-31T20:19:55.7482932Z   |                        ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7483067Z   |
2019-07-31T20:19:55.7483216Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7483390Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7483555Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7483701Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7483955Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7484091Z 
2019-07-31T20:19:55.7484451Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7484804Z Couldn't compile the test.
2019-07-31T20:19:55.7484804Z Couldn't compile the test.
2019-07-31T20:19:55.7485216Z ---- result.rs - result::Result<&'_ mut T, &'_ E>::copied (line 926) stdout ----
2019-07-31T20:19:55.7486341Z  --> result.rs:928:1
2019-07-31T20:19:55.7487315Z   |
2019-07-31T20:19:55.7487315Z   |
2019-07-31T20:19:55.7487535Z 5 | assert_eq!(Err(&1), Err(1));
2019-07-31T20:19:55.7487822Z   | |
2019-07-31T20:19:55.7487822Z   | |
2019-07-31T20:19:55.7487981Z   | expected &{integer}, found integer
2019-07-31T20:19:55.7488134Z   | help: try using a variant of the expected type: `Ok(*right_val)`
2019-07-31T20:19:55.7488279Z   |
2019-07-31T20:19:55.7488421Z   = note: expected type `std::result::Result<_, &{integer}>`
2019-07-31T20:19:55.7492881Z              found type `std::result::Result<_, {integer}>`
2019-07-31T20:19:55.7493984Z 
2019-07-31T20:19:55.7494135Z error[E0308]: mismatched types
2019-07-31T20:19:55.7494484Z  --> result.rs:929:1
2019-07-31T20:19:55.7494656Z   |
2019-07-31T20:19:55.7494656Z   |
2019-07-31T20:19:55.7494819Z 6 | assert_eq!(Ok(&mut 42), Ok(42));
2019-07-31T20:19:55.7495926Z   | |
2019-07-31T20:19:55.7496099Z   | expected mutable reference, found integer
2019-07-31T20:19:55.7496099Z   | expected mutable reference, found integer
2019-07-31T20:19:55.7496253Z   | help: try using a variant of the expected type: `Err(*right_val)`
2019-07-31T20:19:55.7496419Z   |
2019-07-31T20:19:55.7496565Z   = note: expected type `std::result::Result<&mut {integer}, _>`
2019-07-31T20:19:55.7496715Z              found type `std::result::Result<{integer}, _>`
2019-07-31T20:19:55.7497436Z 
2019-07-31T20:19:55.7497602Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7497724Z 
2019-07-31T20:19:55.7498115Z For more information about this error, try `rustc --explain E0308`.
2019-07-31T20:19:55.7498115Z For more information about this error, try `rustc --explain E0308`.
2019-07-31T20:19:55.7498489Z Couldn't compile the test.
2019-07-31T20:19:55.7499053Z ---- result.rs - result::Result<&'_ mut T, &'_ mut E>::copied (line 960) stdout ----
2019-07-31T20:19:55.7500034Z  --> result.rs:962:1
2019-07-31T20:19:55.7500389Z   |
2019-07-31T20:19:55.7500389Z   |
2019-07-31T20:19:55.7500530Z 5 | assert_eq!(Err(&mut 1), Err(1));
2019-07-31T20:19:55.7500823Z   | |
2019-07-31T20:19:55.7500962Z   | expected mutable reference, found integer
2019-07-31T20:19:55.7500962Z   | expected mutable reference, found integer
2019-07-31T20:19:55.7501130Z   | help: try using a variant of the expected type: `Ok(*right_val)`
2019-07-31T20:19:55.7501268Z   |
2019-07-31T20:19:55.7501406Z   = note: expected type `std::result::Result<_, &mut {integer}>`
2019-07-31T20:19:55.7501547Z              found type `std::result::Result<_, {integer}>`
2019-07-31T20:19:55.7502352Z 
2019-07-31T20:19:55.7502486Z error[E0308]: mismatched types
2019-07-31T20:19:55.7502804Z  --> result.rs:963:1
2019-07-31T20:19:55.7502999Z   |
2019-07-31T20:19:55.7502999Z   |
2019-07-31T20:19:55.7503140Z 6 | assert_eq!(Ok(&mut 42), Ok(42));
2019-07-31T20:19:55.7503616Z   | |
2019-07-31T20:19:55.7503755Z   | expected mutable reference, found integer
2019-07-31T20:19:55.7503755Z   | expected mutable reference, found integer
2019-07-31T20:19:55.7503999Z   | help: try using a variant of the expected type: `Err(*right_val)`
2019-07-31T20:19:55.7504141Z   |
2019-07-31T20:19:55.7504278Z   = note: expected type `std::result::Result<&mut {integer}, _>`
2019-07-31T20:19:55.7504422Z              found type `std::result::Result<{integer}, _>`
2019-07-31T20:19:55.7505262Z 
2019-07-31T20:19:55.7505417Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7505918Z 
2019-07-31T20:19:55.7506345Z For more information about this error, try `rustc --explain E0308`.
2019-07-31T20:19:55.7506345Z For more information about this error, try `rustc --explain E0308`.
2019-07-31T20:19:55.7506737Z Couldn't compile the test.
2019-07-31T20:19:55.7507170Z ---- result.rs - result::Result<&'_ mut T, E>::cloned_ok (line 997) stdout ----
2019-07-31T20:19:55.7507394Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7507930Z   |
2019-07-31T20:19:55.7508075Z 8 | let cloned = x.cloned();
2019-07-31T20:19:55.7508220Z   |                ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7508383Z   |
2019-07-31T20:19:55.7508383Z   |
2019-07-31T20:19:55.7508531Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7508685Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7508856Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7509308Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7509608Z error: aborting due to previous error
2019-07-31T20:19:55.7509728Z 
2019-07-31T20:19:55.7510302Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7510679Z Couldn't compile the test.
2019-07-31T20:19:55.7510679Z Couldn't compile the test.
2019-07-31T20:19:55.7511450Z ---- result.rs - result::Result<&'_ mut T, E>::copied_ok (line 849) stdout ----
2019-07-31T20:19:55.7511697Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7513046Z   |
2019-07-31T20:19:55.7513046Z   |
2019-07-31T20:19:55.7513117Z 8 | let copied = x.copied();
2019-07-31T20:19:55.7513164Z   |                ^^^^^^ multiple `copied` found
2019-07-31T20:19:55.7513206Z   |
2019-07-31T20:19:55.7513276Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7513331Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7513386Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7513566Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7513661Z error: aborting due to previous error
2019-07-31T20:19:55.7513690Z 
2019-07-31T20:19:55.7514039Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7514237Z Couldn't compile the test.
2019-07-31T20:19:55.7514237Z Couldn't compile the test.
2019-07-31T20:19:55.7514476Z ---- result.rs - result::Result<T, &'_ E>::cloned_err (line 1017) stdout ----
2019-07-31T20:19:55.7514548Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7514775Z   |
2019-07-31T20:19:55.7514817Z 8 | let cloned = x.cloned();
2019-07-31T20:19:55.7514882Z   |                ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7514923Z   |
2019-07-31T20:19:55.7514923Z   |
2019-07-31T20:19:55.7514971Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7515052Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7515112Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7515167Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7515260Z error: aborting due to previous error
2019-07-31T20:19:55.7515653Z 
2019-07-31T20:19:55.7515946Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7516167Z Couldn't compile the test.
2019-07-31T20:19:55.7516167Z Couldn't compile the test.
2019-07-31T20:19:55.7516412Z ---- result.rs - result::Result<T, &'_ E>::copied_err (line 869) stdout ----
2019-07-31T20:19:55.7516469Z error[E0282]: type annotations needed for `std::result::Result<T, &i32>`
2019-07-31T20:19:55.7516725Z   |
2019-07-31T20:19:55.7516725Z   |
2019-07-31T20:19:55.7516766Z 6 | let x = Err(&val);
2019-07-31T20:19:55.7516997Z   |     -   ^^^ cannot infer type for `T`
2019-07-31T20:19:55.7517045Z   |     |
2019-07-31T20:19:55.7517110Z   |     consider giving `x` the explicit type `std::result::Result<T, &i32>`, where the type parameter `T` is specified
2019-07-31T20:19:55.7517219Z error: aborting due to previous error
2019-07-31T20:19:55.7517249Z 
2019-07-31T20:19:55.7517488Z For more information about this error, try `rustc --explain E0282`.
2019-07-31T20:19:55.7517684Z Couldn't compile the test.
2019-07-31T20:19:55.7517684Z Couldn't compile the test.
2019-07-31T20:19:55.7517951Z ---- result.rs - result::Result<T, &'_ mut E>::cloned_err (line 1037) stdout ----
2019-07-31T20:19:55.7518006Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7518259Z   |
2019-07-31T20:19:55.7518302Z 8 | let cloned = x.cloned();
2019-07-31T20:19:55.7518349Z   |                ^^^^^^ multiple `cloned` found
2019-07-31T20:19:55.7518411Z   |
2019-07-31T20:19:55.7518411Z   |
2019-07-31T20:19:55.7518461Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7518525Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7518711Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7518768Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7518846Z error: aborting due to previous error
2019-07-31T20:19:55.7518894Z 
2019-07-31T20:19:55.7519161Z For more information about this error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7519360Z Couldn't compile the test.
2019-07-31T20:19:55.7519360Z Couldn't compile the test.
2019-07-31T20:19:55.7519785Z ---- result.rs - result::Result<T, &'_ mut E>::copied_err (line 889) stdout ----
2019-07-31T20:19:55.7520171Z error[E0425]: cannot find value `cloned` in this scope
2019-07-31T20:19:55.7520445Z   |
2019-07-31T20:19:55.7520445Z   |
2019-07-31T20:19:55.7520486Z 9 | assert_eq!(cloned, Err(12));
2019-07-31T20:19:55.7520648Z 
2019-07-31T20:19:55.7520715Z error[E0034]: multiple applicable items in scope
2019-07-31T20:19:55.7520934Z  --> result.rs:894:16
2019-07-31T20:19:55.7520976Z   |
2019-07-31T20:19:55.7520976Z   |
2019-07-31T20:19:55.7521016Z 8 | let copied = x.copied();
2019-07-31T20:19:55.7521080Z   |                ^^^^^^ multiple `copied` found
2019-07-31T20:19:55.7521119Z   |
2019-07-31T20:19:55.7521165Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, &_>`
2019-07-31T20:19:55.7521236Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, &_>`
2019-07-31T20:19:55.7521288Z   = note: candidate #3 is defined in an impl for the type `std::result::Result<&_, &mut _>`
2019-07-31T20:19:55.7521340Z   = note: candidate #4 is defined in an impl for the type `std::result::Result<&mut _, &mut _>`
2019-07-31T20:19:55.7521431Z error: aborting due to 2 previous errors
2019-07-31T20:19:55.7521459Z 
2019-07-31T20:19:55.7521509Z Some errors have detailed explanations: E0034, E0425.
2019-07-31T20:19:55.7521754Z For more information about an error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7521754Z For more information about an error, try `rustc --explain E0034`.
2019-07-31T20:19:55.7521947Z Couldn't compile the test.
2019-07-31T20:19:55.7521976Z 
2019-07-31T20:19:55.7522032Z failures:
2019-07-31T20:19:55.7522247Z     result.rs - result::Result<&'_ T, &'_ E>::cloned (line 1057)
2019-07-31T20:19:55.7522465Z     result.rs - result::Result<&'_ T, &'_ E>::copied (line 909)
2019-07-31T20:19:55.7522688Z     result.rs - result::Result<&'_ T, &'_ mut E>::cloned (line 1091)
2019-07-31T20:19:55.7522928Z     result.rs - result::Result<&'_ T, &'_ mut E>::copied (line 943)
2019-07-31T20:19:55.7523144Z     result.rs - result::Result<&'_ T, E>::cloned_ok (line 977)
2019-07-31T20:19:55.7523361Z     result.rs - result::Result<&'_ T, E>::copied_ok (line 829)
2019-07-31T20:19:55.7523604Z     result.rs - result::Result<&'_ mut T, &'_ E>::cloned (line 1074)
2019-07-31T20:19:55.7523824Z     result.rs - result::Result<&'_ mut T, &'_ E>::copied (line 926)
2019-07-31T20:19:55.7524057Z     result.rs - result::Result<&'_ mut T, &'_ mut E>::cloned (line 1108)
2019-07-31T20:19:55.7524310Z     result.rs - result::Result<&'_ mut T, &'_ mut E>::copied (line 960)
2019-07-31T20:19:55.7524530Z     result.rs - result::Result<&'_ mut T, E>::cloned_ok (line 997)
2019-07-31T20:19:55.7524749Z     result.rs - result::Result<&'_ mut T, E>::copied_ok (line 849)
2019-07-31T20:19:55.7524986Z     result.rs - result::Result<T, &'_ E>::cloned_err (line 1017)
2019-07-31T20:19:55.7525204Z     result.rs - result::Result<T, &'_ E>::copied_err (line 869)
2019-07-31T20:19:55.7525425Z     result.rs - result::Result<T, &'_ mut E>::cloned_err (line 1037)
2019-07-31T20:19:55.7526101Z     result.rs - result::Result<T, &'_ mut E>::copied_err (line 889)
2019-07-31T20:19:55.7526192Z test result: FAILED. 2364 passed; 16 failed; 15 ignored; 0 measured; 0 filtered out
2019-07-31T20:19:55.7526225Z 
2019-07-31T20:19:55.7778491Z error: test failed, to rerun pass '--doc'
2019-07-31T20:19:55.7792774Z 
2019-07-31T20:19:55.7792774Z 
2019-07-31T20:19:55.7792868Z 
2019-07-31T20:19:55.7793885Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
2019-07-31T20:19:55.7794005Z 
2019-07-31T20:19:55.7794053Z 
2019-07-31T20:19:55.7840586Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-07-31T20:19:55.7840938Z Build completed unsuccessfully in 1:25:03
2019-07-31T20:19:55.7840938Z Build completed unsuccessfully in 1:25:03
2019-07-31T20:19:56.3300402Z ##[error]Bash exited with code '1'.
2019-07-31T20:19:56.3340830Z ##[section]Starting: Checkout
2019-07-31T20:19:56.3342561Z ==============================================================================
2019-07-31T20:19:56.3342609Z Task         : Get sources
2019-07-31T20:19:56.3342845Z 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)

@sfackler
Copy link
Member

sfackler commented Aug 1, 2019

Is there any context in which cloned_err would be used?

This reverts commit 6c13081.
@ksqsf
Copy link
Contributor Author

ksqsf commented Aug 1, 2019

@sfackler Actually I didn't think of a single use case. I'd be more than happy if we could remove _err, but as has been said, that's maybe just me. I'd suggest leaving it here in case someone finds it useful.

Introducing cloned & copied that work on both Ok and Err brings a lot of duplicate code, which is unwanted. (And I forgot to change the doc tests, oops.) I'm going to revert the last change.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (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-08-01T05:41:01.5805058Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-01T05:41:01.5991533Z ##[command]git config gc.auto 0
2019-08-01T05:41:01.6063654Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-01T05:41:01.6118067Z ##[command]git config --get-all http.proxy
2019-08-01T05:41:01.6260509Z ##[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/63166/merge:refs/remotes/pull/63166/merge
---
2019-08-01T05:41:38.5541369Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-01T05:41:38.5541401Z 
2019-08-01T05:41:38.5541616Z   git checkout -b <new-branch-name>
2019-08-01T05:41:38.5541646Z 
2019-08-01T05:41:38.5541716Z HEAD is now at 6f5885edc Merge 4b2f598986e135f0eb070a9be87a5a963e8ff3d4 into 8a58268b5ad9c4a240be349a633069d48991eb0c
2019-08-01T05:41:38.5739893Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-01T05:41:38.5743155Z ==============================================================================
2019-08-01T05:41:38.5743215Z Task         : Bash
2019-08-01T05:41:38.5743281Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-01T06:43:31.8407158Z .................................................................................................... 1400/8819
2019-08-01T06:43:38.0387496Z .................................................................................................... 1500/8819
2019-08-01T06:43:50.9728919Z .................................................................i...............i.................. 1600/8819
2019-08-01T06:43:58.7162908Z .................................................................................................... 1700/8819
2019-08-01T06:44:13.8229622Z ...................................................iiiii............................................ 1800/8819
2019-08-01T06:44:25.3439540Z .................................................................................................... 2000/8819
2019-08-01T06:44:27.9656878Z .................................................................................................... 2100/8819
2019-08-01T06:44:31.6981212Z .................................................................................................... 2200/8819
2019-08-01T06:44:38.4184096Z .................................................................................................... 2300/8819
---
2019-08-01T06:48:40.8539888Z .................................................................................................... 5300/8819
2019-08-01T06:48:48.5470504Z ..............i..................................................................................... 5400/8819
2019-08-01T06:48:54.4029788Z .................................................................................................... 5500/8819
2019-08-01T06:49:07.1684662Z .................................................................................................... 5600/8819
2019-08-01T06:49:21.1759546Z ........ii...i..ii...........i...................................................................... 5700/8819
2019-08-01T06:49:38.3394331Z .................................................................................................... 5900/8819
2019-08-01T06:49:43.3073508Z .................................................................................................... 6000/8819
2019-08-01T06:49:43.3073508Z .................................................................................................... 6000/8819
2019-08-01T06:49:57.7674159Z ........i..ii....................................................................................... 6100/8819
2019-08-01T06:50:17.5063435Z ...................................................i................................................ 6300/8819
2019-08-01T06:50:19.7148232Z .................................................................................................... 6400/8819
2019-08-01T06:50:22.3643752Z .....................i.............................................................................. 6500/8819
2019-08-01T06:50:27.0864805Z .................................................................................................... 6600/8819
---
2019-08-01T06:55:13.5445957Z  finished in 23.422
2019-08-01T06:55:13.5629289Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T06:55:13.7238027Z 
2019-08-01T06:55:13.7238272Z running 146 tests
2019-08-01T06:55:16.9279404Z i....iii......iii..iiii....i............................i..i................i....i.........ii.i.i..i 100/146
2019-08-01T06:55:18.7819349Z iii..............i.........iii.i......ii......
2019-08-01T06:55:18.7821156Z 
2019-08-01T06:55:18.7822670Z  finished in 5.219
2019-08-01T06:55:18.8002588Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T06:55:18.9558930Z 
---
2019-08-01T06:55:21.0984660Z  finished in 2.297
2019-08-01T06:55:21.1175128Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T06:55:21.2760161Z 
2019-08-01T06:55:21.2761262Z running 9 tests
2019-08-01T06:55:21.2762279Z iiiiiiiii
2019-08-01T06:55:21.2764027Z 
2019-08-01T06:55:21.2768878Z  finished in 0.159
2019-08-01T06:55:21.2950759Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T06:55:21.4587076Z 
---
2019-08-01T06:55:40.1263127Z  finished in 18.830
2019-08-01T06:55:40.1467217Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T06:55:40.3151300Z 
2019-08-01T06:55:40.3152015Z running 122 tests
2019-08-01T06:56:05.0218135Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
2019-08-01T06:56:09.7801679Z .i.i......iii.i.....ii
2019-08-01T06:56:09.7803095Z 
2019-08-01T06:56:09.7803332Z  finished in 29.633
2019-08-01T06:56:09.7811574Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T06:56:09.7812134Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-08-01T07:10:27.5837249Z 
2019-08-01T07:10:27.5844393Z    Doc-tests core
2019-08-01T07:10:31.8517655Z 
2019-08-01T07:10:31.8518503Z running 2387 tests
2019-08-01T07:10:45.2888313Z ......iiiii......................................................................................... 100/2387
2019-08-01T07:10:58.2461277Z .........................................................................ii......................... 200/2387
2019-08-01T07:11:29.2815517Z .................................................................................................... 400/2387
2019-08-01T07:11:29.2815517Z .................................................................................................... 400/2387
2019-08-01T07:11:40.9088367Z ..............................i..i.................iiii............................................. 500/2387
2019-08-01T07:12:05.8520097Z .................................................................................................... 700/2387
2019-08-01T07:12:18.2845365Z .................................................................................................... 800/2387
2019-08-01T07:12:31.0374760Z .................................................................................................... 900/2387
2019-08-01T07:12:43.4311586Z .................................................................................................... 1000/2387
---
2019-08-01T07:14:11.1031221Z .................................................................................................... 1700/2387
2019-08-01T07:14:23.9107069Z .................................................................................................... 1800/2387
2019-08-01T07:14:36.6278422Z .................................................................................................... 1900/2387
2019-08-01T07:14:50.9214566Z .................................................................................................... 2000/2387
2019-08-01T07:15:03.9389969Z ...............................................................................................FFFFF 2100/2387
2019-08-01T07:15:19.3829753Z F.FF................................................................................................ 2200/2387
2019-08-01T07:15:36.5108001Z ................................................................................................i... 2300/2387
2019-08-01T07:15:49.1764438Z failures:
2019-08-01T07:15:49.1764505Z 
2019-08-01T07:15:49.1764505Z 
2019-08-01T07:15:49.1765620Z ---- result.rs - result::Result<&'_ T, E>::cloned (line 909) stdout ----
2019-08-01T07:15:49.1765686Z error[E0282]: type annotations needed for `std::result::Result<&i32, E>`
2019-08-01T07:15:49.1765975Z   |
2019-08-01T07:15:49.1765975Z   |
2019-08-01T07:15:49.1766018Z 6 | let x = Ok(&val);
2019-08-01T07:15:49.1766240Z   |     -   ^^ cannot infer type for `E`
2019-08-01T07:15:49.1766286Z   |     |
2019-08-01T07:15:49.1766357Z   |     consider giving `x` the explicit type `std::result::Result<&i32, E>`, where the type parameter `E` is specified
2019-08-01T07:15:49.1766485Z error: aborting due to previous error
2019-08-01T07:15:49.1766535Z 
2019-08-01T07:15:49.1766785Z For more information about this error, try `rustc --explain E0282`.
2019-08-01T07:15:49.1766987Z Couldn't compile the test.
2019-08-01T07:15:49.1766987Z Couldn't compile the test.
2019-08-01T07:15:49.1767243Z ---- result.rs - result::Result<&'_ T, E>::copied (line 829) stdout ----
2019-08-01T07:15:49.1767297Z error[E0282]: type annotations needed for `std::result::Result<&i32, E>`
2019-08-01T07:15:49.1767536Z   |
2019-08-01T07:15:49.1767536Z   |
2019-08-01T07:15:49.1767594Z 6 | let x = Ok(&val);
2019-08-01T07:15:49.1767807Z   |     -   ^^ cannot infer type for `E`
2019-08-01T07:15:49.1767852Z   |     |
2019-08-01T07:15:49.1767922Z   |     consider giving `x` the explicit type `std::result::Result<&i32, E>`, where the type parameter `E` is specified
2019-08-01T07:15:49.1767997Z error: aborting due to previous error
2019-08-01T07:15:49.1768025Z 
2019-08-01T07:15:49.1768289Z For more information about this error, try `rustc --explain E0282`.
2019-08-01T07:15:49.1768741Z Couldn't compile the test.
2019-08-01T07:15:49.1768741Z Couldn't compile the test.
2019-08-01T07:15:49.1768991Z ---- result.rs - result::Result<&'_ mut T, E>::cloned (line 929) stdout ----
2019-08-01T07:15:49.1769067Z error[E0282]: type annotations needed for `std::result::Result<&mut i32, E>`
2019-08-01T07:15:49.1769760Z   |
2019-08-01T07:15:49.1769760Z   |
2019-08-01T07:15:49.1769822Z 6 | let x = Ok(&mut val);
2019-08-01T07:15:49.1770044Z   |     -   ^^ cannot infer type for `E`
2019-08-01T07:15:49.1770089Z   |     |
2019-08-01T07:15:49.1770145Z   |     consider giving `x` the explicit type `std::result::Result<&mut i32, E>`, where the type parameter `E` is specified
2019-08-01T07:15:49.1770241Z error: aborting due to previous error
2019-08-01T07:15:49.1770269Z 
2019-08-01T07:15:49.1770513Z For more information about this error, try `rustc --explain E0282`.
2019-08-01T07:15:49.1770738Z Couldn't compile the test.
2019-08-01T07:15:49.1770738Z Couldn't compile the test.
2019-08-01T07:15:49.1771139Z ---- result.rs - result::Result<&'_ mut T, E>::copied (line 849) stdout ----
2019-08-01T07:15:49.1771217Z error[E0282]: type annotations needed for `std::result::Result<&mut i32, E>`
2019-08-01T07:15:49.1771522Z   |
2019-08-01T07:15:49.1771522Z   |
2019-08-01T07:15:49.1771564Z 6 | let x = Ok(&mut val);
2019-08-01T07:15:49.1771800Z   |     -   ^^ cannot infer type for `E`
2019-08-01T07:15:49.1771847Z   |     |
2019-08-01T07:15:49.1771899Z   |     consider giving `x` the explicit type `std::result::Result<&mut i32, E>`, where the type parameter `E` is specified
2019-08-01T07:15:49.1771997Z error: aborting due to previous error
2019-08-01T07:15:49.1772027Z 
2019-08-01T07:15:49.1772271Z For more information about this error, try `rustc --explain E0282`.
2019-08-01T07:15:49.1772495Z Couldn't compile the test.
2019-08-01T07:15:49.1772495Z Couldn't compile the test.
2019-08-01T07:15:49.1772917Z ---- result.rs - result::Result<T, &'_ E>::cloned_err (line 949) stdout ----
2019-08-01T07:15:49.1772976Z error[E0034]: multiple applicable items in scope
2019-08-01T07:15:49.1773232Z   |
2019-08-01T07:15:49.1773271Z 8 | let cloned = x.cloned();
2019-08-01T07:15:49.1773315Z   |                ^^^^^^ multiple `cloned` found
2019-08-01T07:15:49.1773373Z   |
2019-08-01T07:15:49.1773373Z   |
2019-08-01T07:15:49.1773419Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, _>`
2019-08-01T07:15:49.1773471Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, _>`
2019-08-01T07:15:49.1773560Z error: aborting due to previous error
2019-08-01T07:15:49.1773587Z 
2019-08-01T07:15:49.1773817Z For more information about this error, try `rustc --explain E0034`.
2019-08-01T07:15:49.1774021Z Couldn't compile the test.
2019-08-01T07:15:49.1774021Z Couldn't compile the test.
2019-08-01T07:15:49.1774256Z ---- result.rs - result::Result<T, &'_ E>::copied_err (line 869) stdout ----
2019-08-01T07:15:49.1774328Z error[E0282]: type annotations needed for `std::result::Result<T, &i32>`
2019-08-01T07:15:49.1774575Z   |
2019-08-01T07:15:49.1774575Z   |
2019-08-01T07:15:49.1774629Z 6 | let x = Err(&val);
2019-08-01T07:15:49.1774837Z   |     -   ^^^ cannot infer type for `T`
2019-08-01T07:15:49.1774879Z   |     |
2019-08-01T07:15:49.1774944Z   |     consider giving `x` the explicit type `std::result::Result<T, &i32>`, where the type parameter `T` is specified
2019-08-01T07:15:49.1775016Z error: aborting due to previous error
2019-08-01T07:15:49.1775042Z 
2019-08-01T07:15:49.1775287Z For more information about this error, try `rustc --explain E0282`.
2019-08-01T07:15:49.1775483Z Couldn't compile the test.
2019-08-01T07:15:49.1775483Z Couldn't compile the test.
2019-08-01T07:15:49.1775721Z ---- result.rs - result::Result<T, &'_ mut E>::cloned_err (line 969) stdout ----
2019-08-01T07:15:49.1775788Z error[E0034]: multiple applicable items in scope
2019-08-01T07:15:49.1776018Z   |
2019-08-01T07:15:49.1776056Z 8 | let cloned = x.cloned();
2019-08-01T07:15:49.1776123Z   |                ^^^^^^ multiple `cloned` found
2019-08-01T07:15:49.1776318Z   |
2019-08-01T07:15:49.1776318Z   |
2019-08-01T07:15:49.1776363Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, _>`
2019-08-01T07:15:49.1776430Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, _>`
2019-08-01T07:15:49.1776498Z error: aborting due to previous error
2019-08-01T07:15:49.1776525Z 
2019-08-01T07:15:49.1776801Z For more information about this error, try `rustc --explain E0034`.
2019-08-01T07:15:49.1776996Z Couldn't compile the test.
2019-08-01T07:15:49.1776996Z Couldn't compile the test.
2019-08-01T07:15:49.1777428Z ---- result.rs - result::Result<T, &'_ mut E>::copied_err (line 889) stdout ----
2019-08-01T07:15:49.1777497Z error[E0425]: cannot find value `cloned` in this scope
2019-08-01T07:15:49.1777739Z   |
2019-08-01T07:15:49.1777739Z   |
2019-08-01T07:15:49.1777796Z 9 | assert_eq!(cloned, Err(12));
2019-08-01T07:15:49.1777869Z 
2019-08-01T07:15:49.1777989Z error[E0034]: multiple applicable items in scope
2019-08-01T07:15:49.1778240Z  --> result.rs:894:16
2019-08-01T07:15:49.1778284Z   |
2019-08-01T07:15:49.1778284Z   |
2019-08-01T07:15:49.1778323Z 8 | let copied = x.copied();
2019-08-01T07:15:49.1778383Z   |                ^^^^^^ multiple `copied` found
2019-08-01T07:15:49.1778425Z   |
2019-08-01T07:15:49.1778514Z   = note: candidate #1 is defined in an impl for the type `std::result::Result<&_, _>`
2019-08-01T07:15:49.1778584Z   = note: candidate #2 is defined in an impl for the type `std::result::Result<&mut _, _>`
2019-08-01T07:15:49.1778829Z error: aborting due to 2 previous errors
2019-08-01T07:15:49.1778860Z 
2019-08-01T07:15:49.1778919Z Some errors have detailed explanations: E0034, E0425.
2019-08-01T07:15:49.1779860Z For more information about an error, try `rustc --explain E0034`.
2019-08-01T07:15:49.1779860Z For more information about an error, try `rustc --explain E0034`.
2019-08-01T07:15:49.1780076Z Couldn't compile the test.
2019-08-01T07:15:49.1780108Z 
2019-08-01T07:15:49.1780165Z failures:
2019-08-01T07:15:49.1780421Z     result.rs - result::Result<&'_ T, E>::cloned (line 909)
2019-08-01T07:15:49.1780678Z     result.rs - result::Result<&'_ T, E>::copied (line 829)
2019-08-01T07:15:49.1780941Z     result.rs - result::Result<&'_ mut T, E>::cloned (line 929)
2019-08-01T07:15:49.1781185Z     result.rs - result::Result<&'_ mut T, E>::copied (line 849)
2019-08-01T07:15:49.1781426Z     result.rs - result::Result<T, &'_ E>::cloned_err (line 949)
2019-08-01T07:15:49.1781686Z     result.rs - result::Result<T, &'_ E>::copied_err (line 869)
2019-08-01T07:15:49.1781935Z     result.rs - result::Result<T, &'_ mut E>::cloned_err (line 969)
2019-08-01T07:15:49.1782183Z     result.rs - result::Result<T, &'_ mut E>::copied_err (line 889)
2019-08-01T07:15:49.1782283Z test result: FAILED. 2364 passed; 8 failed; 15 ignored; 0 measured; 0 filtered out
2019-08-01T07:15:49.1782315Z 
2019-08-01T07:15:49.2076009Z error: test failed, to rerun pass '--doc'
2019-08-01T07:15:49.2112905Z 
2019-08-01T07:15:49.2112905Z 
2019-08-01T07:15:49.2114082Z 
2019-08-01T07:15:49.2116447Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
2019-08-01T07:15:49.2116627Z 
2019-08-01T07:15:49.2116659Z 
2019-08-01T07:15:49.2126742Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-08-01T07:15:49.2126838Z Build completed unsuccessfully in 1:27:55
2019-08-01T07:15:49.2126838Z Build completed unsuccessfully in 1:27:55
2019-08-01T07:15:49.6922925Z ##[error]Bash exited with code '1'.
2019-08-01T07:15:49.6958129Z ##[section]Starting: Checkout
2019-08-01T07:15:49.6960325Z ==============================================================================
2019-08-01T07:15:49.6960382Z Task         : Get sources
2019-08-01T07:15:49.6960595Z 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

The job x86_64-gnu-llvm-6.0 of your PR failed (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-08-01T09:13:26.8171310Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-01T09:13:26.8369330Z ##[command]git config gc.auto 0
2019-08-01T09:13:26.8428560Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-01T09:13:26.8484803Z ##[command]git config --get-all http.proxy
2019-08-01T09:13:26.8619405Z ##[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/63166/merge:refs/remotes/pull/63166/merge
---
2019-08-01T09:14:02.0941776Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-01T09:14:02.0941805Z 
2019-08-01T09:14:02.0941998Z   git checkout -b <new-branch-name>
2019-08-01T09:14:02.0942026Z 
2019-08-01T09:14:02.0942100Z HEAD is now at 514170168 Merge a45f843ee298e5a8b68eeb46361a3dc9da8c2514 into 8a58268b5ad9c4a240be349a633069d48991eb0c
2019-08-01T09:14:02.1096034Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-01T09:14:02.1099222Z ==============================================================================
2019-08-01T09:14:02.1099289Z Task         : Bash
2019-08-01T09:14:02.1099331Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-01T10:13:09.3076429Z .................................................................................................... 1400/8819
2019-08-01T10:13:15.4649286Z .................................................................................................... 1500/8819
2019-08-01T10:13:28.6080068Z .................................................................i...............i.................. 1600/8819
2019-08-01T10:13:36.3404365Z .................................................................................................... 1700/8819
2019-08-01T10:13:51.8935108Z ...................................................iiiii............................................ 1800/8819
2019-08-01T10:14:03.6259317Z .................................................................................................... 2000/8819
2019-08-01T10:14:06.2743271Z .................................................................................................... 2100/8819
2019-08-01T10:14:10.2346716Z .................................................................................................... 2200/8819
2019-08-01T10:14:17.0172424Z .................................................................................................... 2300/8819
---
2019-08-01T10:18:19.2457689Z .................................................................................................... 5300/8819
2019-08-01T10:18:26.8057367Z ..............i..................................................................................... 5400/8819
2019-08-01T10:18:32.4244658Z .................................................................................................... 5500/8819
2019-08-01T10:18:45.0811000Z .................................................................................................... 5600/8819
2019-08-01T10:18:58.7571661Z ........ii...i..ii...........i...................................................................... 5700/8819
2019-08-01T10:19:15.9396033Z .................................................................................................... 5900/8819
2019-08-01T10:19:20.9234093Z .................................................................................................... 6000/8819
2019-08-01T10:19:20.9234093Z .................................................................................................... 6000/8819
2019-08-01T10:19:35.1230643Z ........i..ii....................................................................................... 6100/8819
2019-08-01T10:19:54.4834137Z ...................................................i................................................ 6300/8819
2019-08-01T10:19:56.7219926Z .................................................................................................... 6400/8819
2019-08-01T10:19:59.2316577Z .....................i.............................................................................. 6500/8819
2019-08-01T10:20:03.9450645Z .................................................................................................... 6600/8819
---
2019-08-01T10:24:50.8807667Z  finished in 23.300
2019-08-01T10:24:50.8995570Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T10:24:51.0669083Z 
2019-08-01T10:24:51.0670418Z running 146 tests
2019-08-01T10:24:54.5053016Z i....iii......iii..iiii....i............................i..i................i....i.........ii.i.i..i 100/146
2019-08-01T10:24:56.4640379Z iii..............i.........iii.i......ii......
2019-08-01T10:24:56.4641819Z 
2019-08-01T10:24:56.4648416Z  finished in 5.565
2019-08-01T10:24:56.4838429Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T10:24:56.6476992Z 
---
2019-08-01T10:24:58.8306700Z  finished in 2.346
2019-08-01T10:24:58.8495455Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T10:24:59.0150442Z 
2019-08-01T10:24:59.0151268Z running 9 tests
2019-08-01T10:24:59.0152136Z iiiiiiiii
2019-08-01T10:24:59.0152884Z 
2019-08-01T10:24:59.0157818Z  finished in 0.166
2019-08-01T10:24:59.0371379Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T10:24:59.2105200Z 
---
2019-08-01T10:25:18.2510475Z  finished in 19.214
2019-08-01T10:25:18.2711145Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T10:25:18.4356173Z 
2019-08-01T10:25:18.4356604Z running 122 tests
2019-08-01T10:25:43.1086936Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
2019-08-01T10:25:47.9934085Z .i.i......iii.i.....ii
2019-08-01T10:25:47.9937733Z 
2019-08-01T10:25:47.9939495Z  finished in 29.722
2019-08-01T10:25:47.9949145Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-01T10:25:47.9949504Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-08-01T10:40:03.9595403Z 
2019-08-01T10:40:03.9596292Z    Doc-tests core
2019-08-01T10:40:08.0227838Z 
2019-08-01T10:40:08.0228948Z running 2387 tests
2019-08-01T10:40:20.8642169Z ......iiiii......................................................................................... 100/2387
2019-08-01T10:40:33.4167099Z .........................................................................ii......................... 200/2387
2019-08-01T10:41:03.4963289Z .................................................................................................... 400/2387
2019-08-01T10:41:03.4963289Z .................................................................................................... 400/2387
2019-08-01T10:41:14.2764712Z ..............................i..i.................iiii............................................. 500/2387
2019-08-01T10:41:37.0768051Z .................................................................................................... 700/2387
2019-08-01T10:41:49.1071447Z .................................................................................................... 800/2387
2019-08-01T10:42:01.0409685Z .................................................................................................... 900/2387
2019-08-01T10:42:12.9270566Z .................................................................................................... 1000/2387
---
2019-08-01T10:44:51.3387810Z ................................................................................................i... 2300/2387
2019-08-01T10:45:02.7003790Z .......................................................................................
2019-08-01T10:45:02.7004229Z failures:
2019-08-01T10:45:02.7004467Z 
2019-08-01T10:45:02.7005400Z ---- result.rs - result::Result<&'_ T, E>::cloned (line 909) stdout ----
2019-08-01T10:45:02.7006021Z error: expected pattern, found `:`
2019-08-01T10:45:02.7007573Z   |
2019-08-01T10:45:02.7007573Z   |
2019-08-01T10:45:02.7007841Z 6 | let: Result<&i32, i32> x = Ok(&val);
2019-08-01T10:45:02.7008306Z 
2019-08-01T10:45:02.7008581Z error: aborting due to previous error
2019-08-01T10:45:02.7008790Z 
2019-08-01T10:45:02.7009306Z Couldn't compile the test.
2019-08-01T10:45:02.7009306Z Couldn't compile the test.
2019-08-01T10:45:02.7009875Z 
2019-08-01T10:45:02.7010146Z failures:
2019-08-01T10:45:02.7010665Z     result.rs - result::Result<&'_ T, E>::cloned (line 909)
2019-08-01T10:45:02.7011182Z test result: FAILED. 2371 passed; 1 failed; 15 ignored; 0 measured; 0 filtered out
2019-08-01T10:45:02.7011386Z 
2019-08-01T10:45:02.7270749Z error: test failed, to rerun pass '--doc'
2019-08-01T10:45:02.7286243Z 
2019-08-01T10:45:02.7286243Z 
2019-08-01T10:45:02.7286337Z 
2019-08-01T10:45:02.7287853Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
2019-08-01T10:45:02.7288062Z 
2019-08-01T10:45:02.7288099Z 
2019-08-01T10:45:02.7302704Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-08-01T10:45:02.7304322Z Build completed unsuccessfully in 1:24:45
2019-08-01T10:45:02.7304322Z Build completed unsuccessfully in 1:24:45
2019-08-01T10:45:03.3051407Z ##[error]Bash exited with code '1'.
2019-08-01T10:45:03.3085537Z ##[section]Starting: Checkout
2019-08-01T10:45:03.3087725Z ==============================================================================
2019-08-01T10:45:03.3087789Z Task         : Get sources
2019-08-01T10:45:03.3087830Z 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)

@sfackler
Copy link
Member

sfackler commented Aug 2, 2019

Yeah, let's remove the error variants.

Come to think of it, I'm having a hard time thinking of a context where I had a Result<&T, E> either. Out of curiosity, where does that come up for you?

@ksqsf
Copy link
Contributor Author

ksqsf commented Aug 2, 2019

My use case for cloned/copied: I have a cache around a database, and queries will return shared references Result<&T, Err> to data held by the cache. Whenever I want to make changes and write them back, I need to clone the contents. I did try cloned at the time but later found out only Option has got it.

@wirelessringo
Copy link

Ping from triage @sfackler any updates on this? Thanks.

@ksqsf
Copy link
Contributor Author

ksqsf commented Aug 13, 2019

ping @sfackler

@totsteps
Copy link
Member

Second ping from triage, @sfackler can you please review this.

Thanks

@Alexendoo
Copy link
Member

Ping from triage, requesting a review @rust-lang/libs

@Dylan-DPC-zz
Copy link

Dylan-DPC-zz commented Aug 30, 2019

@ksqsf can you resolve the conflicts failing tests while we get either them or someone from the team to review it? thanks

@ksqsf
Copy link
Contributor Author

ksqsf commented Sep 1, 2019

@Dylan-DPC Hi, I just ran the tests locally (./x.py test --doc src/libcore) and there are no failing tests. Let me know if there's something I overlooked.

@alexcrichton
Copy link
Member

@bors: r+

This looks good to me to add as unstable. I added some explicit questions to the tracking issue to make sure we get back to them by stabilization.

@bors
Copy link
Contributor

bors commented Sep 3, 2019

📌 Commit 61e5286 has been approved by alexcrichton

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 3, 2019
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 3, 2019
Centril added a commit to Centril/rust that referenced this pull request Sep 4, 2019
Add Result::cloned{,_err} and Result::copied{,_err}

This is a little nice addition to `Result`.

1. I'm not sure how useful are `cloned_err` and `copied_err`, but for the sake of completeness they are here.
2. Naming is similar to `map`/`map_err`. I thought about naming `cloned` as `cloned_ok` and add another method called `cloned` that clones both Ok and Err, but `cloned_ok` should be more prevalent than `cloned_both`.
bors added a commit that referenced this pull request Sep 4, 2019
Rollup of 10 pull requests

Successful merges:

 - #63166 (Add Result::cloned{,_err} and Result::copied{,_err})
 - #63930 (Account for doc comments coming from proc macros without spans)
 - #63985 (Stabilize pin_into_inner in 1.39.0)
 - #64023 (libstd fuchsia fixes)
 - #64030 (Fix unlock ordering in SGX synchronization primitives)
 - #64041 (use TokenStream rather than &[TokenTree] for built-in macros)
 - #64043 (Add some more tests for underscore imports)
 - #64092 (Update xLTO compatibility table in rustc book.)
 - #64120 (Move path parsing earlier)
 - #64123 (Added warning around code with reference to uninit bytes)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Sep 4, 2019

⌛ Testing commit 61e5286 with merge 5f42f3e...

bors added a commit that referenced this pull request Sep 4, 2019
Add Result::cloned{,_err} and Result::copied{,_err}

This is a little nice addition to `Result`.

1. I'm not sure how useful are `cloned_err` and `copied_err`, but for the sake of completeness they are here.
2. Naming is similar to `map`/`map_err`. I thought about naming `cloned` as `cloned_ok` and add another method called `cloned` that clones both Ok and Err, but `cloned_ok` should be more prevalent than `cloned_both`.
@bors
Copy link
Contributor

bors commented Sep 4, 2019

☀️ Test successful - checks-azure
Approved by: alexcrichton
Pushing 5f42f3e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 4, 2019
@bors bors merged commit 61e5286 into rust-lang:master Sep 4, 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.

10 participants