-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
@bors delegate=skade |
✌️ @skade can now approve this pull request |
Ping from triage @skade! This PR needs your review. |
Ping from triage @skade / @rust-lang/docs: This PR requires your review. |
src/libstd/error.rs
Outdated
@@ -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`] |
There was a problem hiding this comment.
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.
Also, this isn't only a doc PR, you added cc @rust-lang/compiler |
I have fixed the line and remove |
Still missing examples (also you remove the |
Hey, I am currently traveling, will look at this again in around 3 weeks. |
/// let a_boxed_error = Box::<Error>::from(an_error); | ||
/// assert!(mem::size_of::<Box<dyn Error>>() == mem::size_of_val(&a_boxed_error)) | ||
/// } | ||
/// ``` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good yes!
The job Click to expand the log.
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 |
@GuillaumeGomez examples were added |
Please remove all |
Cool thanks @GuillaumeGomez |
Thanks! @bors: r+ rollup |
📌 Commit 30f2e96 has been approved by |
…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.
…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.
…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.
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
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.