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 doc for impl From for Std Error #53523

Merged
merged 3 commits into from
Oct 4, 2018
Merged

Add doc for impl From for Std Error #53523

merged 3 commits into from
Oct 4, 2018

Conversation

phungleson
Copy link
Contributor

As part of issue #51430 (cc @skade).

I am not sure if it is going to a correct direction so put up here so that people can comment.

@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 Aug 20, 2018
@dtolnay
Copy link
Member

dtolnay commented Aug 20, 2018

@bors delegate=skade

@bors
Copy link
Contributor

bors commented Aug 20, 2018

✌️ @skade can now approve this pull request

@pietroalbini
Copy link
Member

Ping from triage @skade! This PR needs your review.

@TimNN
Copy link
Contributor

TimNN commented Sep 4, 2018

Ping from triage @skade / @rust-lang/docs: This PR requires your review.

@@ -152,20 +152,27 @@ pub trait Error: Debug + Display {

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
/// Converts a type of [`Error`] into a box of dyn [`Error`]
Copy link
Member

Choose a reason for hiding this comment

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

Please add a dot at the end of the sentence.

@GuillaumeGomez
Copy link
Member

Also, this isn't only a doc PR, you added #[inline]. Please add missing examples.

cc @rust-lang/compiler

@phungleson
Copy link
Contributor Author

I have fixed the line and remove inline to make the PR simple.

@GuillaumeGomez
Copy link
Member

Still missing examples (also you remove the [inline] adds so no need for @rust-lang/compiler team anymore).

@phungleson
Copy link
Contributor Author

Hey, I am currently traveling, will look at this again in around 3 weeks.

@TimNN TimNN 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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 11, 2018
/// let a_boxed_error = Box::<Error>::from(an_error);
/// assert!(mem::size_of::<Box<dyn Error>>() == mem::size_of_val(&a_boxed_error))
/// }
/// ```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @GuillaumeGomez I have added a simple example, does it look ok?

If yes I will do similar things to other places.

Copy link
Member

Choose a reason for hiding this comment

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

Looks good yes!

@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:04:29] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:30] tidy error: /checkout/src/libstd/error.rs:291: line longer than 100 chars
[00:04:30] tidy error: /checkout/src/libstd/error.rs:312: line longer than 100 chars
[00:04:30] tidy error: /checkout/src/libstd/error.rs:314: trailing whitespace
[00:04:30] tidy error: /checkout/src/libstd/error.rs:347: trailing whitespace
[00:04:30] tidy error: /checkout/src/libstd/error.rs:369: line longer than 100 chars
[00:04:30] tidy error: /checkout/src/libstd/error.rs:412: line longer than 100 chars
[00:04:31] some tidy checks failed
[00:04:31] 
[00:04:31] 
[00:04:31] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:31] 
[00:04:31] 
[00:04:31] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:31] Build completed unsuccessfully in 0:00:51
[00:04:31] Build completed unsuccessfully in 0:00:51
[00:04:31] Makefile:79: recipe for target 'tidy' failed
[00:04:31] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:11979090
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:153a3335:start=1537876316145521285,finish=1537876316151274104,duration=5752819
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:11475cc6
$ 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 --batch -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:01adffa6
travis_time:start:01adffa6
$ 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
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:142b8cf0
$ dmesg | grep -i kill

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)

@phungleson
Copy link
Contributor Author

@GuillaumeGomez examples were added

@GuillaumeGomez
Copy link
Member

Please remove all fn main() functions, just keep the code inside. rustdoc wraps the code in a fn main in any case (except for extern crate stuff) if there is none so in here it's just noise.

@phungleson
Copy link
Contributor Author

Cool thanks @GuillaumeGomez main has been removed

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Oct 3, 2018

📌 Commit 30f2e96 has been approved by GuillaumeGomez

@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 Oct 3, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Oct 3, 2018
…ror, r=GuillaumeGomez

Add doc for impl From for Std Error

As part of issue rust-lang#51430 (cc @skade).

I am not sure if it is going to a correct direction so put up here so that people can comment.
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 3, 2018
…ror, r=GuillaumeGomez

Add doc for impl From for Std Error

As part of issue rust-lang#51430 (cc @skade).

I am not sure if it is going to a correct direction so put up here so that people can comment.
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 4, 2018
…ror, r=GuillaumeGomez

Add doc for impl From for Std Error

As part of issue rust-lang#51430 (cc @skade).

I am not sure if it is going to a correct direction so put up here so that people can comment.
bors added a commit that referenced this pull request Oct 4, 2018
Rollup of 10 pull requests

Successful merges:

 - #53523 (Add doc for impl From for Std Error)
 - #54746 (simplify some unused lints code)
 - #54761 (Make spec_extend use for_each())
 - #54769 (Fix typo in CONTRIBUTING.md)
 - #54773 (Update a FIXME in memory.rs)
 - #54777 (abolish ICE when pretty-printing async block)
 - #54780 (Remove duplicate predicates in `explicit_predicates_of`)
 - #54788 (A handful of cleanups for rustc/mir)
 - #54789 (Introduce `TyKind::UnnormalizedProjection`)
 - #54795 (remove padding from multiline format string label)

Failed merges:

r? @ghost
@bors bors merged commit 30f2e96 into rust-lang:master Oct 4, 2018
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants