@@ -229,16 +229,11 @@ impl char {
229
229
///
230
230
/// Passing a large radix, causing a panic:
231
231
///
232
- /// ```
233
- /// use std::thread;
232
+ /// ```should_panic
234
233
/// use std::char;
235
234
///
236
- /// let result = thread::spawn(|| {
237
- /// // this panics
238
- /// let c = char::from_digit(1, 37);
239
- /// }).join();
240
- ///
241
- /// assert!(result.is_err());
235
+ /// // this panics
236
+ /// char::from_digit(1, 37);
242
237
/// ```
243
238
#[ unstable( feature = "assoc_char_funcs" , reason = "recently added" , issue = "71763" ) ]
244
239
#[ inline]
@@ -282,15 +277,9 @@ impl char {
282
277
///
283
278
/// Passing a large radix, causing a panic:
284
279
///
285
- /// ```
286
- /// use std::thread;
287
- ///
288
- /// let result = thread::spawn(|| {
289
- /// // this panics
290
- /// '1'.is_digit(37);
291
- /// }).join();
292
- ///
293
- /// assert!(result.is_err());
280
+ /// ```should_panic
281
+ /// // this panics
282
+ /// '1'.is_digit(37);
294
283
/// ```
295
284
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
296
285
#[ inline]
@@ -337,14 +326,9 @@ impl char {
337
326
///
338
327
/// Passing a large radix, causing a panic:
339
328
///
340
- /// ```
341
- /// use std::thread;
342
- ///
343
- /// let result = thread::spawn(|| {
344
- /// '1'.to_digit(37);
345
- /// }).join();
346
- ///
347
- /// assert!(result.is_err());
329
+ /// ```should_panic
330
+ /// // this panics
331
+ /// '1'.to_digit(37);
348
332
/// ```
349
333
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
350
334
#[ inline]
@@ -646,17 +630,11 @@ impl char {
646
630
///
647
631
/// A buffer that's too small:
648
632
///
649
- /// ```
650
- /// use std::thread;
651
- ///
652
- /// let result = thread::spawn(|| {
653
- /// let mut b = [0; 1];
654
- ///
655
- /// // this panics
656
- /// 'ß'.encode_utf8(&mut b);
657
- /// }).join();
633
+ /// ```should_panic
634
+ /// let mut b = [0; 1];
658
635
///
659
- /// assert!(result.is_err());
636
+ /// // this panics
637
+ /// 'ß'.encode_utf8(&mut b);
660
638
/// ```
661
639
#[ stable( feature = "unicode_encode_char" , since = "1.15.0" ) ]
662
640
#[ inline]
@@ -687,17 +665,11 @@ impl char {
687
665
///
688
666
/// A buffer that's too small:
689
667
///
690
- /// ```
691
- /// use std::thread;
692
- ///
693
- /// let result = thread::spawn(|| {
694
- /// let mut b = [0; 1];
695
- ///
696
- /// // this panics
697
- /// '𝕊'.encode_utf16(&mut b);
698
- /// }).join();
668
+ /// ```should_panic
669
+ /// let mut b = [0; 1];
699
670
///
700
- /// assert!(result.is_err());
671
+ /// // this panics
672
+ /// '𝕊'.encode_utf16(&mut b);
701
673
/// ```
702
674
#[ stable( feature = "unicode_encode_char" , since = "1.15.0" ) ]
703
675
#[ inline]
0 commit comments