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 Option::xor method #50553

Merged
merged 1 commit into from
May 18, 2018
Merged

Add Option::xor method #50553

merged 1 commit into from
May 18, 2018

Conversation

clarfonthey
Copy link
Contributor

Implements the method requested in #50512.

@rust-highfive
Copy link
Collaborator

r? @sfackler

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

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

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

Click to expand the log.
[01:13:15] 
[01:13:15] error: test failed, to rerun pass '--doc'
[01:13:15] 
[01:13:15] 
[01:13:15] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
[01:13:15] 
[01:13:15] 
[01:13:15] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:13:15] Build completed unsuccessfully in 0:32:19
[01:13:15] Build completed unsuccessfully in 0:32:19
[01:13:15] Makefile:58: recipe for target 'check' failed
[01:13:15] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2a402f21
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@ishitatsuyuki
Copy link
Contributor

Please go over the RFC process before implementing a new library function.

@Mark-Simulacrum
Copy link
Member

The RFC process is not generally necessary for adding unstable library features; approval from the libs team is sufficient.

@oli-obk oli-obk added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 9, 2018
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
[01:18:51] ....................................................................................................
[01:19:10] ..........................i.................................................................
[01:19:10] failures:
[01:19:10] 
[01:19:10] ---- option.rs - option::Option<T>::xor (line 715) stdout ----
[01:19:10]  thread 'option.rs - option::Option<T>::xor (line 715)' panicked at 'test executable failed:
[01:19:10] thread 'main' panicked at 'assertion failed: `(left == right)`
[01:19:10] thread 'main' panicked at 'assertion failed: `(left == right)`
[01:19:10]   left: `Some(2)`,
[01:19:10]  right: `None`', option.rs:12:1
[01:19:10] 
[01:19:10] ', librustdoc/test.rs:356:17
[01:19:10] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:19:10] 
---
[01:19:10] 
[01:19:10] error: test failed, to rerun pass '--doc'
[01:19:10] 
[01:19:10] 
[01:19:10] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
[01:19:10] 
[01:19:10] 
[01:19:10] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:19:10] Build completed unsuccessfully in 0:34:32
[01:19:10] Build completed unsuccessfully in 0:34:32
[01:19:10] Makefile:58: recipe for target 'check' failed
[01:19:10] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:00a83011
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed May  9 06:33:51 UTC 2018
0 ./obj/build/bootstrap/debug/incremental/bootstrap-1wl4zjaz72e5d/s-f0v6lhbkmm-7mne91-3a8ftmql7i7fg
113068 ./obj/build/x86_64-unknown-linux-gnu/test/mir-opt
112640 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu
112636 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release
108644 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps
108644 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps
103488 ./obj/build/bootstrap/debug/incremental/bootstrap-2wettvttcntnm
103484 ./obj/build/bootstrap/debug/incremental/bootstrap-2wettvttcntnm/s-f0v7s1ubrs-9bdn3m-2ysq90q36kyjn
98488 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental
93316 ./obj/build/x86_64-unknown-linux-gnu/stage1
93292 ./obj/build/x86_64-unknown-linux-gnu/stage1/lib
90808 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz
90808 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz
90804 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz/s-f0v7ppoiyy-rt72ks-dwv0lu6ptg5j
86672 ./obj/build/x86_64-unknown-linux-gnu/doc/core
81220 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps
80928 ./obj/build/x86_64-unknown-linux-gnu/doc/std
79032 ./obj/build/x86_64-unknown-linux-gnu/stage0-sysroot

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)

///
/// let x: Option<u32> = None;
/// let y = Some(2);
/// assert_eq!(x.xor(y), None);
Copy link
Contributor

Choose a reason for hiding this comment

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

x.xor(y) should return Some(2) in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, fixed.

@sfackler
Copy link
Member

Seems plausible for me.

cc @rust-lang/libs

@bors r+

@bors
Copy link
Contributor

bors commented May 17, 2018

📌 Commit 8ab2d15 has been approved by sfackler

@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 May 17, 2018
@kennytm
Copy link
Member

kennytm commented May 17, 2018

@bors rollup

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 17, 2018
Add Option::xor method

Implements the method requested in rust-lang#50512.
bors added a commit that referenced this pull request May 18, 2018
Rollup of 10 pull requests

Successful merges:

 - #50387 (Remove leftover tab in libtest outputs)
 - #50553 (Add Option::xor method)
 - #50610 (Improve format string errors)
 - #50649 (Tweak `nearest_common_ancestor()`.)
 - #50790 (Fix grammar documentation wrt Unicode identifiers)
 - #50791 (Fix null exclusions in grammar docs)
 - #50806 (Add `bless` x.py subcommand for easy ui test replacement)
 - #50818 (Speed up `opt_normalize_projection_type`)
 - #50837 (Revert #49767)
 - #50839 (Make sure people know the book is free oline)

Failed merges:
@bors bors merged commit 8ab2d15 into rust-lang:master May 18, 2018
@clarfonthey clarfonthey deleted the option_xor branch May 18, 2018 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants