@@ -229,16 +229,11 @@ impl char {
229229 ///
230230 /// Passing a large radix, causing a panic:
231231 ///
232- /// ```
233- /// use std::thread;
232+ /// ```should_panic
234233 /// use std::char;
235234 ///
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);
242237 /// ```
243238 #[ unstable( feature = "assoc_char_funcs" , reason = "recently added" , issue = "71763" ) ]
244239 #[ inline]
@@ -282,15 +277,9 @@ impl char {
282277 ///
283278 /// Passing a large radix, causing a panic:
284279 ///
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);
294283 /// ```
295284 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
296285 #[ inline]
@@ -337,14 +326,9 @@ impl char {
337326 ///
338327 /// Passing a large radix, causing a panic:
339328 ///
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);
348332 /// ```
349333 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
350334 #[ inline]
@@ -646,17 +630,11 @@ impl char {
646630 ///
647631 /// A buffer that's too small:
648632 ///
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];
658635 ///
659- /// assert!(result.is_err());
636+ /// // this panics
637+ /// 'ß'.encode_utf8(&mut b);
660638 /// ```
661639 #[ stable( feature = "unicode_encode_char" , since = "1.15.0" ) ]
662640 #[ inline]
@@ -687,17 +665,11 @@ impl char {
687665 ///
688666 /// A buffer that's too small:
689667 ///
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];
699670 ///
700- /// assert!(result.is_err());
671+ /// // this panics
672+ /// '𝕊'.encode_utf16(&mut b);
701673 /// ```
702674 #[ stable( feature = "unicode_encode_char" , since = "1.15.0" ) ]
703675 #[ inline]
0 commit comments