@@ -123,7 +123,7 @@ use crate::fmt::{self, Write};
123
123
/// the `Debug` output means `Report` is an ideal starting place for formatting errors returned
124
124
/// from `main`.
125
125
///
126
- /// ```should_panic
126
+ /// ```
127
127
/// #![feature(error_reporter)]
128
128
/// use std::error::Report;
129
129
/// # use std::error::Error;
@@ -154,10 +154,14 @@ use crate::fmt::{self, Write};
154
154
/// # Err(SuperError { source: SuperErrorSideKick })
155
155
/// # }
156
156
///
157
- /// fn main () -> Result<(), Report<SuperError>> {
157
+ /// fn run () -> Result<(), Report<SuperError>> { {
158
158
/// get_super_error()?;
159
159
/// Ok(())
160
160
/// }
161
+ ///
162
+ /// fn main() {
163
+ /// assert!(run().is_err());
164
+ /// }
161
165
/// ```
162
166
///
163
167
/// This example produces the following output:
@@ -170,7 +174,7 @@ use crate::fmt::{self, Write};
170
174
/// output format. If you want to make sure your `Report`s are pretty printed and include backtrace
171
175
/// you will need to manually convert and enable those flags.
172
176
///
173
- /// ```should_panic
177
+ /// ```
174
178
/// #![feature(error_reporter)]
175
179
/// use std::error::Report;
176
180
/// # use std::error::Error;
@@ -201,12 +205,16 @@ use crate::fmt::{self, Write};
201
205
/// # Err(SuperError { source: SuperErrorSideKick })
202
206
/// # }
203
207
///
204
- /// fn main () -> Result<(), Report<SuperError>> {
208
+ /// fn run () -> Result<(), Report<SuperError>> {
205
209
/// get_super_error()
206
210
/// .map_err(Report::from)
207
211
/// .map_err(|r| r.pretty(true).show_backtrace(true))?;
208
212
/// Ok(())
209
213
/// }
214
+ ///
215
+ /// fn main() {
216
+ /// assert!(run().is_err());
217
+ /// }
210
218
/// ```
211
219
///
212
220
/// This example produces the following output:
0 commit comments