File tree Expand file tree Collapse file tree 4 files changed +5
-28
lines changed 
src/tools/unicode-table-generator/src Expand file tree Collapse file tree 4 files changed +5
-28
lines changed Original file line number Diff line number Diff line change @@ -950,7 +950,11 @@ impl char {
950950    #[ stable( feature = "rust1" ,  since = "1.0.0" ) ]  
951951    #[ inline]  
952952    pub  fn  is_control ( self )  -> bool  { 
953-         unicode:: Cc ( self ) 
953+         // According to 
954+         // https://www.unicode.org/policies/stability_policy.html#Property_Value, 
955+         // the set of codepoints in `Cc` will never change. 
956+         // So we can just hard-code the patterns to match against instead of using a table. 
957+         matches ! ( self ,  '\0' ..='\x1f'  | '\x7f' ..='\u{9f}' ) 
954958    } 
955959
956960    /// Returns `true` if this `char` has the `Grapheme_Extend` property. 
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ pub use unicode_data::conversions;
99
1010#[ rustfmt:: skip]  
1111pub ( crate )  use  unicode_data:: alphabetic:: lookup as  Alphabetic ; 
12- pub ( crate )  use  unicode_data:: cc:: lookup as  Cc ; 
1312pub ( crate )  use  unicode_data:: grapheme_extend:: lookup as  Grapheme_Extend ; 
1413pub ( crate )  use  unicode_data:: lowercase:: lookup as  Lowercase ; 
1514pub ( crate )  use  unicode_data:: n:: lookup as  N ; 
Original file line number Diff line number Diff line change @@ -358,31 +358,6 @@ pub mod cased {
358358    } 
359359} 
360360
361- #[ rustfmt:: skip]  
362- pub  mod  cc { 
363-     use  super :: ShortOffsetRunHeader ; 
364- 
365-     static  SHORT_OFFSET_RUNS :  [ ShortOffsetRunHeader ;  1 ]  = [ 
366-         ShortOffsetRunHeader :: new ( 0 ,  1114272 ) , 
367-     ] ; 
368-     static  OFFSETS :  [ u8 ;  5 ]  = [ 
369-         0 ,  32 ,  95 ,  33 ,  0 , 
370-     ] ; 
371-     pub  fn  lookup ( c :  char )  -> bool  { 
372-         const  { 
373-             assert ! ( SHORT_OFFSET_RUNS . last( ) . unwrap( ) . 0  > char :: MAX  as  u32 ) ; 
374-             let  mut  i = 0 ; 
375-             while  i < SHORT_OFFSET_RUNS . len ( )  { 
376-                 assert ! ( SHORT_OFFSET_RUNS [ i] . start_index( )  < OFFSETS . len( ) ) ; 
377-                 i += 1 ; 
378-             } 
379-         } 
380-         // SAFETY: We just ensured the last element of `SHORT_OFFSET_RUNS` is greater than `std::char::MAX` 
381-         // and the start indices of all elements in `SHORT_OFFSET_RUNS` are smaller than `OFFSETS.len()`. 
382-         unsafe  {  super :: skip_search ( c,  & SHORT_OFFSET_RUNS ,  & OFFSETS )  } 
383-     } 
384- } 
385- 
386361#[ rustfmt:: skip]  
387362pub  mod  grapheme_extend { 
388363    use  super :: ShortOffsetRunHeader ; 
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ static PROPERTIES: &[&str] = &[
9292    "Case_Ignorable" , 
9393    "Grapheme_Extend" , 
9494    "White_Space" , 
95-     "Cc" , 
9695    "N" , 
9796] ; 
9897
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments