@@ -1450,10 +1450,13 @@ macro_rules! from_str_radix {
1450
1450
/// # Examples
1451
1451
///
1452
1452
/// Basic usage:
1453
- ///
1454
1453
/// ```
1455
1454
#[ doc = concat!( "assert_eq!(" , stringify!( $int_ty) , "::from_str_radix(\" A\" , 16), Ok(10));" ) ]
1456
1455
/// ```
1456
+ /// Trailing space returns error:
1457
+ /// ```
1458
+ #[ doc = concat!( "assert_matches!(" , stringify!( $int_ty) , "::from_str_radix(\" 1 \" , 10), Err(_));" ) ]
1459
+ /// ```
1457
1460
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1458
1461
#[ rustc_const_unstable( feature = "const_int_from_str" , issue = "59133" ) ]
1459
1462
pub const fn from_str_radix( src: & str , radix: u32 ) -> Result <$int_ty, ParseIntError > {
@@ -1591,10 +1594,13 @@ macro_rules! from_str_radix_size_impl {
1591
1594
/// # Examples
1592
1595
///
1593
1596
/// Basic usage:
1594
- ///
1595
1597
/// ```
1596
1598
#[ doc = concat!( "assert_eq!(" , stringify!( $size) , "::from_str_radix(\" A\" , 16), Ok(10));" ) ]
1597
1599
/// ```
1600
+ /// Trailing space returns error:
1601
+ /// ```
1602
+ #[ doc = concat!( "assert_matches!(" , stringify!( $size) , "::from_str_radix(\" 1 \" , 10), Err(_));" ) ]
1603
+ /// ```
1598
1604
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1599
1605
#[ rustc_const_unstable( feature = "const_int_from_str" , issue = "59133" ) ]
1600
1606
pub const fn from_str_radix( src: & str , radix: u32 ) -> Result <$size, ParseIntError > {
0 commit comments