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

Soft-deprecate the description() method of the Error trait #49536

Closed
wants to merge 4 commits into from

Conversation

SimonSapin
Copy link
Contributor

@SimonSapin SimonSapin commented Mar 31, 2018

By providing a default impl and documenting that Display should be used instead.

Closes rust-lang/rfcs#2230.

@SimonSapin SimonSapin added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Mar 31, 2018
@TimNN
Copy link
Contributor

TimNN commented Mar 31, 2018

Your PR failed on Travis. 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:45] configure: rust.quiet-tests     := True
---
own-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/libcore-811292bee4a6b310.rlib --extern rustc_msan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/librustc_msan-8f121ecb2ef84243.rlib --extern alloc_system=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/liballoc_system-ed94ac9e95a953a9.rlib --extern std_unicode=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/libstd_unicode-f731a3424083b368.rlib --extern rustc_lsan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/librustc_lsan-1410504746f3eb9d.rlib --extern alloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/liballoc-f4197e0a3464c45b.rlib --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/liblibc-e9a2e369a8083b56.rlib --extern rustc_tsan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/librustc_tsan-93c1730e5717941a.rlib --extern panic_abort=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/libpanic_abort-2234dbc2506589a0.rlib --extern unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/libunwind-3a7f3b36e2e0dd49.rlib --extern compiler_builtins=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/libcompiler_builtins-ff09c44a7756c865.rlib --extern alloc_jemalloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/liballoc_jemalloc-82a61418a3e6acfa.rlib --extern panic_unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/libpanic_unwind-0281a77030a2b8a8.rlib --extern rustc_asan=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/librustc_asan-871ff8b487f739dc.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/native/libbacktrace/.libs -l static=backtrace -l dl -l rt -l pthread -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/native/jemalloc/lib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/build/compiler_builtins-5f97a23c46e5cafe/out` (exit code: 101)
[00:03:35] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:03:35] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1064:9
---
[00:03:35] Makefile:79: recipe for target 'tidy' failed
[00:03:35] make: *** [tidy] Error 1
---
$ cat obj/tmp/sccache.log
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:14f96484:start=1522491907709116248,finish=1522491907715033540,duration=5917292
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:04e1724d
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:04e1724d:start=1522491907720052630,finish=1522491907726043036,duration=5990406
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0553a3be
$ dmesg | grep -i kill
[   10.431358] init: failsafe main process (1093) killed by TERM signal

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.

@SimonSapin
Copy link
Contributor Author

I think that failed travis build may have been interrupted when I force-pushed an amended commit to the PR’s branch?

@SimonSapin
Copy link
Contributor Author

This change is as discussed in the libs meeting this week.

r? @alexcrichton

@@ -89,7 +75,10 @@ pub trait Error: Debug + Display {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn description(&self) -> &str;
#[doc(hidden)]
fn description(&self) -> &str {
Copy link
Member

Choose a reason for hiding this comment

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

Should we deprecate the method as well, or are we waiting until this lands in stable channel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we should wait until the default impl is stable if we're gonna emit a deprecation warning, but I'm not sure than doing that is worth it. We mostly want to make it unnecessary to implement this method, no need to actively remove it from existing code.

@TimNN
Copy link
Contributor

TimNN commented Mar 31, 2018

Your PR failed on Travis. 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:45] configure: rust.quiet-tests     := True
---
[00:41:25] .........................................................................i..........................
[00:41:31] ................i...................................................................................
---
[00:42:07] ............................................................................................i.......
[00:42:14] ................................................................i...................................
---
[00:43:09] .............................................i......................................................
---
[00:47:05] .............................i......................................................................
[00:47:19] ..............................................................i.....................................
[00:47:35] ...............................................i....................................................
[00:47:55] ....................................................................................................
[00:48:17] ....................................................................................................
[00:48:38] ....................................................................................................
[00:49:03] .i................................................................................................i.
[00:49:30] ..................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:49:40] ..................
[00:50:10] ....................................................................................................
[00:50:47] ...............................................................ii...................................
[00:51:32] ..........................i....................................................i.ii...test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:51:37] ..............
[00:52:18] .......................................................................................iiiiiii......
---
[00:54:17] ....................................i...............................................................
[00:54:25] ....................................................................................................
[00:54:32] ..................i............................................................ii.iii...............
[00:54:40] ....................................................................................................
[00:54:48] ........i..............................i............................................................
[00:54:55] ....................................................................................................
[00:55:02] .....................i..............................................................................
[00:55:10] ....................................................................................................
[00:55:20] ....................................................................................................
[00:55:30] ....................................................................................................
[00:55:41] ....................................................................................................
[00:55:55] ....................................................................................................
[00:56:04] ..............i.....................................................................................
[00:56:13] .................i..ii..............................................................................
[00:56:23] ....................................................................................................
[00:56:33] ....................................................................................................
[00:56:43] ....................................................................................i...............
[00:56:53] ..............................i.....................................................................
---
[00:57:30] ...........................i........................................................................
[00:57:32] ....................................................................i...............................
[00:57:33] ................i.......................................................
---
[00:57:47] ...........i........................
---
[00:58:18] i...i..ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[00:58:21] i.......i......................i......
---
[00:58:58] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[00:59:00] ....ii...
---
[01:08:24] ...i................................................................................................
---
[01:10:21] ......................................i.............................................................
[01:10:42] ....................................................................................................
[01:11:03] .............................................i......................................................
---
[01:12:34] ........................................................ii..........................................
---
[01:13:40] .............................................................i......................................
---
[01:18:33] ii..................................................................................................
[01:18:53] ....................................................................................................
[01:19:09] ..................iii......i......i...i......i......................................................
[01:19:20] ....................................................................................................
[01:19:36] .......................................iiii........ii...............................................
[01:19:46] ....................................................................................................
[01:20:05] ................................................................................i...................
[01:20:30] ....................................................................................................
[01:20:41] ..........................................................................................iiii......
---
[01:27:00] book/first-edition/print.html:11983: broken link fragment `#tymethod.description` pointing to `std/error/trait.Error.html`
[01:27:00] book/first-edition/error-handling.html:1345: broken link fragment `#tymethod.description` pointing to `std/error/trait.Error.html`
[01:27:06] thread 'main' panicked at 'found some broken links', tools/linkchecker/main.rs:49:9
---
[01:27:06] make: *** [check] Error 1
[01:27:06] Makefile:58: recipe for target 'check' failed

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.

@@ -89,7 +75,10 @@ pub trait Error: Debug + Display {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn description(&self) -> &str;
#[doc(hidden)]
Copy link
Member

Choose a reason for hiding this comment

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

I don't think hiding this in the docs is a good idea. It's still a stable function so the docs need to include something for it. I suggest just changing the docs above instead.

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 assume you mean something like “if it exists it should be documented”. The point of this change is to try to make it as if the method did not exist anymore, except without breaking code that already implements or calls it.

Copy link
Member

Choose a reason for hiding this comment

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

“if it exists it should be documented”

Yeah, is that controversial?

The point of this change is to try to make it as if the method did not exist anymore

You can't rewrite history. What do you expect people to do if they see this method used in code and want to find out what it does, or in fact why it's depreciated? I don't see the problem with just making it clear in the documentation that this method is deprecated and shouldn't be used any more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is that controversial?

No, not that part.

You can't rewrite history.

Shrug I don’t really care either way, this PR was only motivated by making sure that the outcome of last week’s libs meetings were not lost in a forgotten Dropbox Paper doc. At this point I’ll leave it to someone else in @rust-lang/libs to decide.

@SimonSapin
Copy link
Contributor Author

The book’s first edition has a couple links to the description method that are now broken. I don’t feel like dealing with the submodule dance at the moment.

@SimonSapin
Copy link
Contributor Author

Possible fix in the book repo:

diff --git a/first-edition/src/error-handling.md b/first-edition/src/error-handling.md
index e2f3995c..ad8690ad 100644
--- a/first-edition/src/error-handling.md
+++ b/first-edition/src/error-handling.md
@@ -1340,7 +1340,8 @@ There's one little nit left: the `Box<Error>` type is *opaque*. If we
 return a `Box<Error>` to the caller, the caller can't (easily) inspect
 underlying error type. The situation is certainly better than `String`
 because the caller can call methods like
-[`description`](../../std/error/trait.Error.html#tymethod.description)
+[`to_string`](../../std/string/trait.ToString.html#tymethod.to_string)
+(through the [`Display`](../../std/fmt/trait.Display.html) trait)
 and [`cause`](../../std/error/trait.Error.html#method.cause), but the
 limitation remains: `Box<Error>` is opaque. (N.B. This isn't entirely
 true because Rust does have runtime reflection, which is useful in

@TimNN
Copy link
Contributor

TimNN commented Apr 1, 2018

Your PR failed on Travis. 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.
Resolving deltas: 100% (613519/613519), completed with 4860 local objects.
---
[00:00:00] Attempting with retry: sh -c rm -f download-src-doc-book.tar.gz &&         curl -sSL -o download-src-doc-book.tar.gz https://github.com/rust-lang/book/archive/bf0fff309c6a92af2aecb255fb2a272da5124f54.tar.gz
---
[00:00:41] configure: rust.quiet-tests     := True
---
[00:38:56] .........................................................................i..........................
[00:39:01] ................i...................................................................................
---
[00:39:36] ............................................................................................i.......
[00:39:43] .................................................................i..................................
---
[00:40:36] .............................................i......................................................
---
[00:44:21] .............................i......................................................................
[00:44:35] ..............................................................i.....................................
[00:44:50] ...............................................i....................................................
[00:45:09] ....................................................................................................
[00:45:30] ....................................................................................................
[00:45:51] ....................................................................................................
[00:46:15] .i................................................................................................i.
[00:46:43] ......................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:46:50] ..............
[00:47:20] ....................................................................................................
[00:47:55] ...............................................................ii...................................
[00:48:40] ..........................i....................................................i.ii......test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:48:43] ...........
[00:49:22] .......................................................................................iiiiiii......
---
[00:51:19] ....................................i...............................................................
[00:51:27] ....................................................................................................
[00:51:34] ..................i............................................................ii.iii...............
[00:51:41] ....................................................................................................
[00:51:49] ........i..............................i............................................................
[00:51:56] ....................................................................................................
[00:52:03] .....................i..............................................................................
[00:52:10] ....................................................................................................
[00:52:20] ....................................................................................................
[00:52:30] ....................................................................................................
[00:52:41] ....................................................................................................
[00:52:54] ....................................................................................................
[00:53:04] ..............i.....................................................................................
[00:53:14] .................i..ii..............................................................................
[00:53:23] ....................................................................................................
[00:53:33] ....................................................................................................
[00:53:42] ....................................................................................i...............
[00:53:53] ..............................i.....................................................................
---
[00:54:29] ...........................i........................................................................
[00:54:30] ....................................................................i...............................
[00:54:31] ................i.......................................................
---
[00:54:45] ...........i........................
---
[00:55:15] i...i..ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[00:55:18] i.......i......................i......
---
[00:55:54] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[00:55:55] ....ii...
---
[01:04:51] ...i................................................................................................
---
[01:06:42] ......................................i.............................................................
[01:07:01] ....................................................................................................
[01:07:20] .............................................i......................................................
---
[01:08:46] ........................................................ii..........................................
---
[01:09:48] .............................................................i......................................
---
[01:14:26] ii..................................................................................................
[01:14:44] ....................................................................................................
[01:15:00] ..................iii......i......i...i......i......................................................
[01:15:09] ....................................................................................................
[01:15:25] .......................................iiii........ii...............................................
[01:15:35] ....................................................................................................
[01:15:51] ......................................................................................i.............
---
[01:22:28] book/unsized-types.html:46: broken link fragment `#dynamically-sized-types--sized` pointing to `book/second-edition/ch19-04-advanced-types.html`
[01:22:34] thread 'main' panicked at 'found some broken links', tools/linkchecker/main.rs:49:9
---
[01:22:34] Makefile:58: recipe for target 'check' failed
[01:22:34] make: *** [check] Error 1
---
$ cat obj/tmp/sccache.log
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:01987a94:start=1522615183969562899,finish=1522615183984448455,duration=14885556
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:13aeba10
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:13aeba10:start=1522615183990196254,finish=1522615183996285963,duration=6089709
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0bd378c0
$ dmesg | grep -i kill
[   10.591637] init: failsafe main process (1094) killed by TERM signal

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.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Looks good to me. This is as we discussed at the all-hands. I sympathize with ollie27's comments but I believe having this visible in the Error trait, even deprecated, would continue to cause more harm/confusion than benefit.

@alexcrichton
Copy link
Member

@SimonSapin perhaps a comment about the description method could be added to explain why it's deprecated and no longer visible? It may be best as well to link to an issue with future plans to integrate failure into libstd, but I'm not sure that exists yet so we can hold off on that.

It was out of date, and rustdoc already shows the same information.
@SimonSapin
Copy link
Contributor Author

Changed the PR so that the method stays visible in docs, but docs suggest to use Display instead and not implement it.

It is redundant with Display while being much less flexible for implementors.

This is only a "soft" deprecation: it is not worth the hassle of a warning to existing users.
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Apr 5, 2018

📌 Commit 21923d8 has been approved by alexcrichton

@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 Apr 5, 2018
@TimNN
Copy link
Contributor

TimNN commented Apr 5, 2018

Your PR failed on Travis. 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-book.tar.gz &&         curl -sSL -o download-src-doc-book.tar.gz https://github.com/rust-lang/book/archive/bf0fff309c6a92af2aecb255fb2a272da5124f54.tar.gz
---
[00:00:45] configure: rust.quiet-tests     := True
---
[00:51:52] ..........................................................................i.........................
[00:52:00] .................i..................................................................................
---
[00:52:41] .............................................................................................i......
[00:52:50] ...................................................................i................................
---
[00:53:59] .............................................i......................................................
---
[00:58:51] .............................i......................................................................
[00:59:08] ..............................................................i.....................................
[00:59:26] ...............................................i....................................................
[00:59:50] ....................................................................................................
[01:00:16] ....................................................................................................
[01:00:42] ....................................................................................................
[01:01:12] .i...............................................................................................i..
[01:01:33] ...............................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[01:01:57] .....................................................
[01:02:33] ....................................................................................................
[01:03:19] .............................................................ii.....................................
[01:03:58] ........................i.............................test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[01:04:18] .......................i.ii...................
[01:05:06] .....................................................................................iiiiiii........
---
[01:08:39] ..................i............................................................ii.iii...............
[01:08:48] ....................................................................................................
[01:08:57] ........i..............................i............................................................
[01:09:06] ....................................................................................................
[01:09:14] ....................i...............................................................................
[01:09:23] ....................................................................................................
[01:09:35] ....................................................................................................
[01:09:46] ....................................................................................................
[01:09:59] ....................................................................................................
[01:10:14] ....................................................................................................
[01:10:17] .............i.............test [compile-fail] compile-fail/issue-22638.rs has been running for over 60 seconds
[01:10:26] .........................................................................
[01:10:37] ................i..ii...............................................................................
[01:10:49] ....................................................................................................
[01:11:00] ....................................................................................................
[01:11:10] ..................................................................................i.................
[01:11:21] .............................i......................................................................
---
[01:12:01] ............................i.......................................................................
[01:12:03] ....................................................................i...............................
[01:12:04] ................i.......................................................
---
[01:12:22] ...........i........................
---
[01:12:56] i....i.ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[01:13:00] i.......i......................i......
---
[01:13:46] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[01:13:47] ....ii...
---
[01:26:12] .....i..............................................................................................
---
[01:28:49] .....................................i..............................................................
[01:29:17] ....................................................................................................
[01:29:45] ..........................................i.........................................................
---
[01:31:36] .........................................................ii.........................................
---
[01:33:01] ..............................................................i.....................................
---
[01:39:11] ii..................................................................................................
[01:39:33] .................F..................................................................................
[01:39:53] ..................iii......i......i...i......i......................................................
[01:40:06] ....................................................................................................
[01:40:25] ........................................iiii........ii..............................................
[01:40:39] ....................................................................................................
[01:40:59] .......................................................................................i............
[01:41:31] ....................................................................................................
[01:41:45] .................................................................................................iii
[01:41:57] i...............................................
[01:41:57] failures:
[01:41:57]
[01:41:57] ---- error.rs - error::Error::description (line 65) stdout ----
[01:41:57]  error: unused import: `std::error::Error`
[01:41:57]  --> error.rs:66:5
---
[01:41:57]   = note: #[deny(unused_imports)] implied by #[deny(warnings)]
[01:41:57]
[01:41:57] thread 'error.rs - error::Error::description (line 65)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
---
[01:41:57] 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" "std" "--" "--quiet"
[01:41:57] expected success, got: exit code: 101
[01:41:57]
[01:41:57]
[01:41:57] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:41:57] Build completed unsuccessfully in 0:51:36
[01:41:57] Makefile:58: recipe for target 'check' failed
[01:41:57] make: *** [check] Error 1

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.

@alexcrichton
Copy link
Member

@bors: r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 5, 2018
@TimNN
Copy link
Contributor

TimNN commented Apr 5, 2018

Your PR failed on Travis. 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-book.tar.gz &&         curl -sSL -o download-src-doc-book.tar.gz https://github.com/rust-lang/book/archive/bf0fff309c6a92af2aecb255fb2a272da5124f54.tar.gz
---
[00:00:50] configure: rust.quiet-tests     := True
---
[00:37:01] ..........................................................................i.........................
[00:37:06] .................i..................................................................................
---
[00:37:39] .............................................................................................i......
[00:37:45] ...................................................................i................................
---
[00:38:35] .............................................i......................................................
---
[00:42:07] .............................i......................................................................
[00:42:21] ..............................................................i.....................................
[00:42:35] ...............................................i....................................................
[00:42:54] ....................................................................................................
[00:43:14] ....................................................................................................
[00:43:34] ....................................................................................................
[00:43:57] .i...............................................................................................i..
[00:44:26] ...........................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:44:30] .........
[00:44:58] ....................................................................................................
[00:45:31] .............................................................ii.....................................
[00:46:17] ........................i....................................................i.ii..................test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:46:17] .
[00:46:53] .....................................................................................iiiiiii........
---
[00:49:03] ..................i............................................................ii.iii...............
[00:49:10] ....................................................................................................
[00:49:18] ........i..............................i............................................................
[00:49:25] ....................................................................................................
[00:49:31] ....................i...............................................................................
[00:49:39] ....................................................................................................
[00:49:48] ....................................................................................................
[00:49:58] ....................................................................................................
[00:50:08] ....................................................................................................
[00:50:20] ....................................................................................................
[00:50:28] .............i......................................................................................
[00:50:37] ................i..ii...............................................................................
[00:50:46] ....................................................................................................
[00:50:56] ....................................................................................................
[00:51:05] ..................................................................................i.................
[00:51:15] ............................i.......................................................................
---
[00:51:49] ............................i.......................................................................
[00:51:50] ....................................................................i...............................
[00:51:52] ................i.......................................................
---
[00:52:05] ...........i........................
---
[00:52:33] i...i..ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[00:52:35] i.......i......................i......
---
[00:53:10] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[00:53:11] ....ii...
---
[01:01:28] .....i..............................................................................................
---
[01:03:12] .....................................i..............................................................
[01:03:30] ....................................................................................................
[01:03:49] ..........................................i.........................................................
---
[01:05:13] .........................................................ii.........................................
---
[01:06:12] ..............................................................i.....................................
---
[01:10:40] ii..................................................................................................
[01:10:58] ....................................................................................................
[01:11:14] ..................iii......i......i...i......i......................................................
[01:11:23] ....................................................................................................
[01:11:38] ........................................iiii........ii..............................................
[01:11:49] ....................................................................................................
[01:12:05] .......................................................................................i............
---
[01:18:37] book/unsized-types.html:46: broken link fragment `#dynamically-sized-types--sized` pointing to `book/second-edition/ch19-04-advanced-types.html`
[01:18:44] thread 'main' panicked at 'found some broken links', tools/linkchecker/main.rs:49:9
---
[01:18:44] Makefile:58: recipe for target 'check' failed
[01:18:44] make: *** [check] Error 1
p/debug/incremental/bootstrap-232achgbjnpqy
116944 ./obj/build/bootstrap/debug/incremental/bootstrap-232achgbjnpqy/s-ezu1gmo2hu-17mdby9-280tmya5nj9iw
112704 ./obj/build/x86_64-unknown-linux-gnu/test/mir-opt
108028 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
102764 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz
102760 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz/s-ezu2ckk1ph-1ahxhus-3ftfukr7x0u51
96664 ./obj/build/bootstrap/debug/incremental/bootstrap-1vuwt8xpr9ahn
96660 ./obj/build/bootstrap/debug/incremental/bootstrap-1vuwt8xpr9ahn/s-ezu2epy371-8lkmmo-19o368fejew27
---
56344 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental/syntax-33oa6nnkk1g08/s-ezu2e00b7d-19d4n0n-1gy35pqxf06dw
---
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:02d3d6bc:start=1522936967222032260,finish=1522936967228807589,duration=6775329
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:3cd41760
$ dmesg | grep -i kill
[   10.415917] init: failsafe main process (1093) killed by TERM signal

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.

@TimNN
Copy link
Contributor

TimNN commented Apr 5, 2018

Your PR failed on Travis. 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:45] configure: rust.quiet-tests     := True
---
[00:38:53] ..........................................................................i.........................
[00:38:59] .................i..................................................................................
---
[00:39:35] .............................................................................................i......
[00:39:42] ...................................................................i................................
---
[00:40:36] .............................................i......................................................
---
[00:44:23] .............................i......................................................................
[00:44:38] ..............................................................i.....................................
[00:44:54] ...............................................i....................................................
[00:45:14] ....................................................................................................
[00:45:35] ....................................................................................................
[00:45:56] ....................................................................................................
[00:46:21] .i...............................................................................................i..
[00:46:48] ....................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:46:56] ................
[00:47:26] ....................................................................................................
[00:48:01] .............................................................ii.....................................
[00:48:46] ........................i....................................................i.ii........test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:48:51] ...........
[00:49:31] .....................................................................................iiiiiii........
---
[00:51:45] ..................i............................................................ii.iii...............
[00:51:52] ....................................................................................................
[00:52:00] ........i..............................i............................................................
[00:52:07] ....................................................................................................
[00:52:14] ....................i...............................................................................
[00:52:22] ....................................................................................................
[00:52:31] ....................................................................................................
[00:52:42] ....................................................................................................
[00:52:52] ....................................................................................................
[00:53:05] ....................................................................................................
[00:53:13] .............i......................................................................................
[00:53:22] ................i..ii...............................................................................
[00:53:32] ....................................................................................................
[00:53:42] ....................................................................................................
[00:53:52] ...................................................................................i................
[00:54:02] .............................i......................................................................
---
[00:54:38] ...........................i........................................................................
[00:54:40] ....................................................................i...............................
[00:54:41] ................i.......................................................
---
[00:54:55] ...........i........................
---
[00:55:25] i...i..ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[00:55:28] i.......i......................i......
---
[00:56:05] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[00:56:06] ....ii...
---
[01:04:29] .....i..............................................................................................
---
[01:06:21] .....................................i..............................................................
[01:06:39] ....................................................................................................
[01:06:58] ..........................................i.........................................................
---
[01:08:29] .........................................................ii.........................................
---
[01:09:30] ..............................................................i.....................................
---
[01:14:22] ii..................................................................................................
[01:14:42] ....................................................................................................
[01:15:00] ..................iii......i......i...i......i......................................................
[01:15:09] ....................................................................................................
[01:15:26] ........................................iiii........ii..............................................
[01:15:36] ....................................................................................................
[01:15:54] .......................................................................................i............
---
[01:23:03] book/first-edition/print.html:11997: broken link fragment `#tymethod.description` pointing to `std/error/trait.Error.html`
[01:23:03] book/first-edition/error-handling.html:1359: broken link fragment `#tymethod.description` pointing to `std/error/trait.Error.html`
[01:23:09] thread 'main' panicked at 'found some broken links', tools/linkchecker/main.rs:49:9
---
[01:23:09] make: *** [check] Error 1
[01:23:09] Makefile:58: recipe for target 'check' failed
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:2587c68c:start=1522958376202010501,finish=1522958376218764202,duration=16753701
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:15ac55a0
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:15ac55a0:start=1522958376231947723,finish=1522958376247602754,duration=15655031
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0fea7ee0
$ dmesg | grep -i kill
[   10.692253] init: failsafe main process (1093) killed by TERM signal

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.

/// }
/// _ => println!("No error"),
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn description(&self) -> &str;
fn description(&self) -> &str {
""
Copy link
Member

Choose a reason for hiding this comment

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

Hm, could we at least make this something like "default error description" or "error"? I worry that existing code that calls this would be confusing to read output logs when description isn't implemented since println!("{}", e.description()); results in an empty line being printed -- giving no indication as to the source, making such a problem hard to debug.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something along lines of "use Display to get the description"?

@SimonSapin
Copy link
Contributor Author

I’m not going to keep pushing this, anyone else feel free to pick it up.

@SimonSapin SimonSapin closed this Apr 20, 2018
bors added a commit that referenced this pull request Apr 30, 2018
Bury Error::description()

Second attempt of #49536 rust-lang/rfcs#2230

The exact wording of the default implementation is still up in the air, but I think it's a detail that can be amended later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

None yet

8 participants