@@ -269,6 +269,8 @@ pub type Backtrace = ();
269269mod quick_error;
270270#[ macro_use]
271271mod error_chain;
272+ #[ cfg( feature = "example_generated" ) ]
273+ pub mod example_generated;
272274
273275/// Iterator over the error chain.
274276pub struct ErrorChainIter < ' a > ( pub Option < & ' a error:: Error > ) ;
@@ -389,43 +391,3 @@ impl State {
389391 b
390392 }
391393}
392-
393- /// This modules show an example of code generated by the macro. IT MUST NOT BE
394- /// USED OUTSIDE THIS CRATE.
395- ///
396- /// This is the basic error structure. You can see that `ErrorKind`
397- /// has been populated in a variety of ways. All `ErrorKind`s get a
398- /// `Msg` variant for basic errors. When strings are converted to
399- /// `ErrorKind`s they become `ErrorKind::Msg`. The "links" defined in
400- /// the macro are expanded to the `Inner` variant, and the
401- /// "foreign links" to the `Io` variant.
402- ///
403- /// Both types come with a variety of `From` conversions as well:
404- /// `Error` can be created from `ErrorKind`, `&str` and `String`,
405- /// and the `links` and `foreign_links` error types. `ErrorKind`
406- /// can be created from the corresponding `ErrorKind`s of the link
407- /// types, as well as from `&str` and `String`.
408- ///
409- /// `into()` and `From::from` are used heavily to massage types into
410- /// the right shape. Which one to use in any specific case depends on
411- /// the influence of type inference, but there are some patterns that
412- /// arise frequently.
413- pub mod example_generated {
414- /// Another code generated by the macro.
415- pub mod inner {
416- error_chain ! { }
417- }
418-
419- error_chain ! {
420- links {
421- Inner ( inner:: Error ) #[ doc = "Link to another `ErrorChain`." ] ;
422- }
423- foreign_links {
424- Io ( :: std:: io:: Error ) #[ doc = "Link to a `std::error::Error` type." ] ;
425- }
426- errors {
427- #[ doc = "A custom error kind." ]
428- Custom
429- }
430- }
431- }
0 commit comments