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

Implement inner deref for Option and Result #50267

Merged
merged 11 commits into from
Jul 31, 2018
Merged

Conversation

U007D
Copy link

@U007D U007D commented Apr 27, 2018

tracking issue: #50264

@rust-highfive
Copy link
Collaborator

r? @dtolnay

(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 Apr 27, 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:12:21] travis_fold:start:test_stage1-core
travis_time:start:test_stage1-core
Testing core stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:12:21]    Compiling core v0.0.0 (file:///checkout/src/libcore)
[01:12:34] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:12:34]    --> libcore/../libcore/tests/option.rs:305:27
[01:12:34]     |
[01:12:34] 305 |     assert_eq!(ref_option.deref(), Some(&42));
[01:12:34]     |
[01:12:34]     |
[01:12:34]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:12:34] 
[01:12:34] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:12:34]    --> libcore/../libcore/tests/option.rs:309:27
[01:12:34]     |
[01:12:34] 309 |     assert_eq!(ref_option.deref(), None);
[01:12:34]     |
[01:12:34]     |
[01:12:34]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:12:34] 
[01:12:35] error[E0599]: no method named `deref_ok` found for type `&std::result::Result<&i32, &u8>` in the current scope
[01:12:35]    --> libcore/../libcore/tests/result.rs:239:23
[01:12:35]     |
[01:12:35] 239 |     assert_eq!(ref_ok.deref_ok(), Ok(&42));
[01:12:35]     |
[01:12:35]     = help: items from traits can only be used if the trait is in scope
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]             candidate #1: `use std::result::ResultDeref;`
[01:12:35] 
[01:12:35] error[E0599]: no method named `deref_ok` found for type `&std::result::Result<&i32, &u8>` in the current scope
[01:12:35]    --> libcore/../libcore/tests/result.rs:240:23
[01:12:35]     |
[01:12:35] 240 |     assert_eq!(ref_ok.deref_ok(), Ok(&42));
[01:12:35]     |
[01:12:35]     = help: items from traits can only be used if the trait is in scope
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]             candidate #1: `use std::result::ResultDeref;`
[01:12:35] 
[01:12:35] error[E0599]: no method named `deref` found for type `&std::result::Result<&i32, &u8>` in the current scope
[01:12:35]    --> libcore/../libcore/tests/result.rs:241:23
[01:12:35]     |
[01:12:35] 241 |     assert_eq!(ref_ok.deref(), Ok(&42));
[01:12:35]     |
[01:12:35]     = help: items from traits can only be used if the trait is in scope
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]             candidate #1: `use std::result::ResultDeref;`
[01:12:35] 
[01:12:35] error[E0599]: no method named `deref_err` found for type `&std::result::Result<&i32, &u8>` in the current scope
[01:12:35]    --> libcore/../libcore/tests/result.rs:245:24
[01:12:35]     |
[01:12:35] 245 |     assert_eq!(ref_err.deref_err(), Err(&41));
[01:12:35]     |
[01:12:35]     = help: items from traits can only be used if the trait is in scope
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]             candidate #1: `use std::result::ResultDeref;`
[01:12:35] 
[01:12:35] error[E0599]: no method named `deref_err` found for type `&std::result::Result<&i32, &u8>` in the current scope
[01:12:35]    --> libcore/../libcore/tests/result.rs:246:24
[01:12:35]     |
[01:12:35] 246 |     assert_eq!(ref_err.deref_err(), Err(&41));
[01:12:35]     |
[01:12:35]     = help: items from traits can only be used if the trait is in scope
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]             candidate #1: `use std::result::ResultDeref;`
[01:12:35] 
[01:12:35] error[E0599]: no method named `deref` found for type `&std::result::Result<&i32, &u8>` in the current scope
[01:12:35]    --> libcore/../libcore/tests/result.rs:247:24
[01:12:35]     |
[01:12:35] 247 |     assert_eq!(ref_err.deref(), Err(&41));
[01:12:35]     |
[01:12:35]     = help: items from traits can only be used if the trait is in scope
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]             candidate #1: `use std::result::ResultDeref;`
[01:12:35] 
[01:12:35] error[E0599]: no method named `deref_err` found for type `&std::result::Result<&i32, &u8>` in the current scope
[01:12:35]    --> libcore/../libcore/tests/result.rs:250:23
[01:12:35]     |
[01:12:35] 250 |     assert_eq!(ref_ok.deref_err(), Ok(&&42));
[01:12:35]     |
[01:12:35]     = help: items from traits can only be used if the trait is in scope
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]             candidate #1: `use std::result::ResultDeref;`
[01:12:35] 
[01:12:35] error[E0599]: no method named `deref_ok` found for type `&std::result::Result<&i32, &u8>` in the current scope
[01:12:35]    --> libcore/../libcore/tests/result.rs:253:24
[01:12:35]     |
[01:12:35] 253 |     assert_eq!(ref_err.deref_ok(), Err(&&41));
[01:12:35]     |
[01:12:35]     = help: items from traits can only be used if the trait is in scope
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:12:35]             candidate #1: `use std::result::ResultDeref;`
[01:12:36] error: aborting due to 10 previous errors
[01:12:36] 
[01:12:36] Some errors occurred: E0599, E0658.
[01:12:36] For more information about an error, try `rustc --explain E0599`.
---
149116 ./src/llvm-emscripten/test
149024 ./.git/modules
149020 ./.git/modules/src
122708 ./obj/build/bootstrap/debug/incremental/bootstrap-1sil8jgb030ka
122704 ./obj/build/bootstrap/debug/incremental/bootstrap-1sil8jgb030ka/s-f0hrxvhid0-vahhe6-2f3cmz1knheyt
112820 ./obj/build/x86_64-unknown-linux-gnu/test/mir-opt
111052 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu
111048 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release
107176 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps
107176 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps
102808 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
101924 ./obj/build/bootstrap/debug/incremental/bootstrap-2s8ik7x786gic
101920 ./obj/build/bootstrap/debug/incremental/bootstrap-2s8ik7x786gic/s-f0ht2ahrrb-upqz3e-8chh8umqc096
89904 ./obj/build/x86_64-unknown-linux-gnu/stage1
89880 ./obj/build/x86_64-unknown-linux-gnu/stage1/lib
89696 ./src/llvm/test/CodeGen
88292 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz
88292 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz
88288 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz/s-f0hszry5sj-1ynlg71-113338xyxqhne
85124 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps
81160 ./obj/build/x86_64-unknown-linux-gnu/doc/std
78752 ./obj/build/x86_64-unknown-linux-gnu/stage0-sysroot
78748 ./obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib
---
60840 ./src/llvm-emscripten/lib
56092 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin
55348 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release
53568 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/build
51784 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental/syntax-3cudc1zz68gz8
51780 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental/syntax-3cudc1zz68gz8/s-f0ht1jg0v2-1gae625-go2k6as6xr98
48584 ./obj/build/x86_64-unknown-linux-gnu/stage0/bin
47832 ./obj/build/x86_64-unknown-linux-gnu/stage0-std
46780 ./src/test
46660 ./obj/build/x86_64-unknown-linux-gnu/stage0-std/release

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-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:11:12] travis_fold:start:test_stage1-core
travis_time:start:test_stage1-core
Testing core stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:11:12]    Compiling core v0.0.0 (file:///checkout/src/libcore)
[01:11:26] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:11:26]    --> libcore/../libcore/tests/option.rs:305:27
[01:11:26]     |
[01:11:26] 305 |     assert_eq!(ref_option.deref(), Some(&42));
[01:11:26]     |
[01:11:26]     |
[01:11:26]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:11:26] 
[01:11:26] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:11:26]    --> libcore/../libcore/tests/option.rs:309:27
[01:11:26]     |
[01:11:26] 309 |     assert_eq!(ref_option.deref(), None);
[01:11:26]     |
[01:11:26]     |
[01:11:26]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:11:26] 
[01:11:26] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:11:26]    --> libcore/../libcore/tests/result.rs:239:23
[01:11:26]     |
[01:11:26] 239 |     assert_eq!(ref_ok.deref_ok(), Ok(&42));
[01:11:26]     |
[01:11:26]     |
[01:11:26]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:11:26] 
[01:11:26] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:11:26]    --> libcore/../libcore/tests/result.rs:240:23
[01:11:26]     |
[01:11:26] 240 |     assert_eq!(ref_ok.deref_ok(), Ok(&42));
[01:11:26]     |
[01:11:26]     |
[01:11:26]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:11:26] 
[01:11:26] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:11:26]    --> libcore/../libcore/tests/result.rs:241:2m                       ^^^^^^^^^
[01:11:26]     |
[01:11:26]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:11:26] 
[01:11:26] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:11:26]    --> libcore/../libcore/tests/result.rs:247:24
[01:11:26]     |
[01:11:26] 247 |     assert_eq!(ref_err.deref(), Err(&41));
[01:11:26]     |
[01:11:26]     |
[01:11:26]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:11:26] 
[01:11:26] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:11:26]    --> libcore/../libcore/tests/result.rs:250:23
[01:11:26]     |
[01:11:26] 250 |     assert_eq!(ref_ok.deref_err(), Ok(&&42));
[01:11:26]     |
[01:11:26]     |
[01:11:26]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:11:26] 
[01:11:26] error[E0658]: use of unstable library feature 'inner_deref': newly added (see issue #50264)
[01:11:26]    --> libcore/../libcore/tests/result.rs:253:24
[01:11:26]     |
[01:11:26] 253 |     assert_eq!(ref_err.deref_ok(), Err(&&41));
[01:11:26]     |
[01:11:26]     |
[01:11:26]     = help: add #![feature(inner_deref)] to the crate attributes to enable
[01:11:27] error: aborting due to 10 previous errors
[01:11:27] 
[01:11:27] For more information about this error, try `rustc --explain E0658`.
[01:11:27] error: Could not compile `core`.
[01:11:27] error: Could not compile `core`.
[01:11:27] 
[01:11:27] To learn more, run the command again with --verbose.
[01:11:27] 
[01:11:27] 
[01:11:27] 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:11:27] 
[01:11:27] 
[01:11:27] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:11:27] Build completed unsuccessfully in 0:29:42
[01:11:27] Build completed unsuccessfully in 0:29:42
[01:11:27] Makefile:58: recipe for target 'check' failed
[01:11:27] make: *** [check] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:05fdab3a
$ 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)

@@ -909,6 +909,38 @@ impl<T: Default, E> Result<T, E> {
}
}

#[unstable(feature = "inner_deref", reason = "newly added", issue = "50264")]
impl<T: Deref, E: Deref> 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.

For maximum usability, these should probably be three impl blocks. One for T: Deref, one for E: Deref and one with both bounds. Otherwise you can't use deref_ok on a Result<String, u32> I think.

Copy link
Author

@U007D U007D Apr 27, 2018

Choose a reason for hiding this comment

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

Fixed. Great catch--thank you!

@oli-obk
Copy link
Contributor

oli-obk commented Apr 27, 2018

Can you add some more tests? Especially around starting out with non-reference types and checking whether String becomes str, Vec becomes [T], ...

Maybe even compile-fail tests for the cases like Ok(42).deref_ok() and all other variants of it

@U007D
Copy link
Author

U007D commented Apr 27, 2018

Yes, I can do that.

A request: if you have other feedback, it helps to get it all at once (or to know that the review is incomplete, so I will know to wait), since context switching, diving back in, re-running tests, etc. has costs. I'll let this sit for a day or three, in case there is more feedback from you or from others, then I can address the feedback efficiently.

@@ -878,6 +878,17 @@ impl<T: Default> Option<T> {
}
}

# [unstable(feature = "inner_deref", reason = "newly added", issue = "50264")]
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a space between the # and the [

@oli-obk
Copy link
Contributor

oli-obk commented Apr 28, 2018

Other than squashing down (multiple commits are fine, merge commits are not), I have no further suggestions.

@U007D
Copy link
Author

U007D commented Apr 28, 2018

Thanks, @oli-obk.

@QuietMisdreavus
Copy link
Member

I'm not so sure about naming the method deref. That's the same name as the trait method itself. (That was why i had such awkward names in my initial sketch. >_>) Is that going to be okay?

@U007D
Copy link
Author

U007D commented Apr 28, 2018

Is having a function name equal to the trait name automatically bad? If so, why--if adhering to this guideline yields "such awkward names", is the cure as bad as the disease? Or is there a larger problem that this guideline addresses? (Honestly asking to learn.)

If it is a problem, there were also other suggestions made (as you predicted ;)) on the IRC channel including deref_inner() and deref_lift() (or perhaps it was just lift()), IIRC. General consensus was without already knowing what 'lift' means--and most don't--it wasn't particularly informative.

@U007D U007D force-pushed the master branch 2 times, most recently from ea442e5 to a279dc2 Compare April 30, 2018 20:47
@U007D
Copy link
Author

U007D commented Apr 30, 2018

All actionable feedback provided to this point should now be addressed--please let me know if you have any comments or questions.

Everyone, please take a look at src/libcore/tests/result.rs. As this is the first lift function I have written (assuming this is indeed a lift operation), I want to be sure the behavior we are testing for is correct.

In particular, I am concerned about what I have labeled "Odd corner cases" starting on l.293: I'm wondering if, for example, calling deref_err() on an Ok should be allowed (it is, as of today)?

@ExpHP
Copy link
Contributor

ExpHP commented Apr 30, 2018

I'm not so sure about naming the method deref. That's the same name as the trait method itself.

Option::as_ref is guilty of a similar crime.

@QuietMisdreavus
Copy link
Member

I'm wondering if, for example, calling deref_err() on an Ok should be allowed (it is, as of today)?

IMO, deref_ok/deref_err should act similarly to map/map_err - if you call it an instance of the "wrong" variant, nothing happens at all. The purpose of these functions is to transform the type, so if the data in question isn't affected by that, we shouldn't get in the way.

Option::as_ref is guilty of a similar crime.

So it does! In that case (and because Result doesn't impl Deref, and because Deref specifically is an operator trait with special connotations anyway) i totally take back my objections.

@U007D
Copy link
Author

U007D commented May 2, 2018

Option::as_ref is guilty of a similar crime

@ExpHP is it actually a crime though, or are you simply expressing that there is a precedent?

IMO, deref_ok/deref_err should act similarly to map/map_err...

@QuietMisdreavus mmm--I do like that. The only wrinkle I see so far is that map_err()'s signature promises to transform Result<T, E> -> Result<T, F>. Returning Result<T, E> (a no-op) under conditions of the "wrong" variant, is compliant with that contract (there aren't any type restrictions in play preventing F from being an instance of E).

In our case, though, deref_ok() promises to transform &Result<T: Deref, E> into a Result<&T::Deref::Target, &E>, so returning a no-op is a violation of that contract, which leads me to the canonical answer when the function signature cannot be honored--namely panic.

I know that you are aware of this, but for the record I'll state that there is precedent for this in the standard library--the simplest example I can think of is Option::unwrap() transforming an Option<T> -> T, panicking when there is no T to yield.

IMO, having "wrong variant" cases ideally no-op if (contractually) possible and panic if not seems like the right thing to do/expected behavior. In the inner_deref 'odd corner cases' situations, this would mean panics, AFAICT, since the function's signature precludes returning a no-op. What do you think?

@QuietMisdreavus
Copy link
Member

@U007D It seems there's a bit of a misunderstanding here. I'd personally forgotten that the signature also took the reference of the "other" variant when making that statement, but i consider that just fine. I consider these methods as a sort of super-charged as_ref that do something extra for one or both variants (depending on which one you call). The short version of what i'm saying is, i don't want these to panic. The thing you already have set up is fine, IMO.

@ExpHP
Copy link
Contributor

ExpHP commented May 2, 2018

@U007D I was simply stating precedent. To be entirely honest, in my own projects I have more or less adopted it as a convention, and I often have inherent methods named as_ref and as_mut on structures that (a) benefit from having custom reference types and (b) are incapable of providing any useful AsRef impls (e.g. matrices, SoA datatypes...).

@U007D
Copy link
Author

U007D commented Jul 12, 2018

@alexcrichton Great--I'll resolve the conflicts this weekend. Thank you!

@stokhos
Copy link

stokhos commented Jul 20, 2018

Ping from triage @U007D It's been a while since we heard from you, will you have time to work on this again?

@rust-highfive
Copy link
Collaborator

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.
[00:00:00] Attempting with retry: sh -c rm -f download-src-doc-rust-by-example.tar.gz &&         curl -sSL -o download-src-doc-rust-by-example.tar.gz https://github.com/rust-lang/rust-by-example/archive/eebda16e4b45f2eed4310cf7b9872cc752278163.tar.gz
[00:00:00] rm 'src/llvm-emscripten'
[00:00:00] Attempting with retry: sh -c git submodule deinit -f  src/jemalloc src/tools/rust-installer src/liblibc src/doc/nomicon src/tools/cargo src/doc/reference src/tools/rls src/libcompiler_builtins src/tools/clippy src/tools/rustfmt src/tools/miri src/dlmalloc src/stdsimd src/tools/lld src/libbacktrace &&     git submodule sync &&     git submodule update -j 16 --init --recursive  src/jemalloc src/tools/rust-installer src/liblibc src/doc/nomicon src/tools/cargo src/doc/reference src/tools/rls src/libcompiler_builtins src/tools/clippy src/tools/rustfmt src/tools/miri src/dlmalloc src/stdsimd src/tools/lld src/libbacktrace
[00:00:00] Attempting with retry: sh -c rm -f download-src-llvm-emscripten.tar.gz &&         curl -sSL -o download-src-llvm-emscripten.tar.gz https://github.com/rust-lang/llvm/archive/2717444753318e461e0c3b30dacd03ffbac96903.tar.gz
[00:00:00] error: pathspec 'src/libbacktrace' did not match any file(s) known to git.
[00:00:01] Command failed. Attempt 2/5:
[00:00:01] error: pathspec 'src/libbacktrace' did not match any file(s) known to git.
[00:00:03] Command failed. Attempt 3/5:
[00:00:03] error: pathspec 'src/libbacktrace' did not match any file(s) known to git.
22656 ./src/llvm-emscripten/test/MC
21136 ./src/llvm-emscripten/test/Transforms
19740 ./src/llvm-emscripten/test/tools
19348 ./src/test/ui
---
travis_time:end:1e3ba16e:start=1532920038066073138,finish=1532920038071957576,duration=5884438
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:347683a4
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:06f17873
travis_time:start:06f17873
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory

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-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:58:36] travis_fold:start:test_stage1-core
travis_time:start:test_stage1-core
Testing core stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:58:37]    Compiling core v0.0.0 (file:///checkout/src/libcore)
[00:58:37] error: this file contains an un-closed delimiter
[00:58:37]     |
[00:58:37] 331 | }
[00:58:37]     |   ^
[00:58:37]     |
---
[00:58:50] 
[00:58:50] To learn more, run the command again with --verbose.
[00:58:50] 
[00:58:50] 
[00:58:50] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
[00:58:50] 
[00:58:50] 
[00:58:50] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:58:50] Build completed unsuccessfully in 0:17:13
[00:58:50] Build completed unsuccessfully in 0:17:13
[00:58:50] make: *** [check] Error 1
[00:58:50] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:016841a8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:015abfea:start=1532924466526846906,finish=1532924466536894788,duration=10047882
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:24168141
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:08b4d9c0
travis_time:start:08b4d9c0
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory

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

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 30, 2018

📌 Commit 56016cb has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 30, 2018
@Mark-Simulacrum Mark-Simulacrum changed the title inner_deref PR Implement inner deref for Option and Result Jul 30, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 30, 2018
@bors
Copy link
Contributor

bors commented Jul 31, 2018

⌛ Testing commit 56016cb with merge a01fe877531f466aefbe9224f9d7c92ed06a51cd...

@bors
Copy link
Contributor

bors commented Jul 31, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 31, 2018
@rust-highfive
Copy link
Collaborator

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.
curl: (7) Failed to connect to s3-us-west-1.amazonaws.com port 443: Operation timed out
The command "curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin" failed 3 times.
travis_time:end:0fcc8ca7:start=1533015878257073000,finish=1533016235696499000,duration=357439426000

The command "case "$TRAVIS_OS_NAME" in linux) travis_retry curl -fo $HOME/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl && chmod +x $HOME/stamp && export PATH=$PATH:$HOME ;; osx) if [[ "$RUST_CHECK_TARGET" == dist ]]; then travis_retry brew update && travis_retry brew install xz; fi && travis_retry curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin && chmod +x /usr/local/bin/sccache && travis_retry curl -fo /usr/local/bin/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin && chmod +x /usr/local/bin/stamp && travis_retry curl -f http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz | tar xJf - && export CC=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang && export CXX=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang++ && export AR=ar ;; esac" failed and exited with 7 during .
Your build has been stopped.

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)

@pietroalbini
Copy link
Member

@bors retry #40474

@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 Jul 31, 2018
@bors
Copy link
Contributor

bors commented Jul 31, 2018

⌛ Testing commit 56016cb with merge ed8d14d...

bors added a commit that referenced this pull request Jul 31, 2018
Implement inner deref for Option and Result

tracking issue: #50264
@bors
Copy link
Contributor

bors commented Jul 31, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing ed8d14d to master...

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.