File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed 
compiler/rustc_parse/src/parser 
tests/ui/traits/const-traits Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2664,7 +2664,10 @@ impl<'a> Parser<'a> {
26642664                        // Rule out `unsafe extern {`. 
26652665                        && !self . is_unsafe_foreign_mod ( ) 
26662666                        // Rule out `async gen {` and `async gen move {` 
2667-                         && !self . is_async_gen_block ( ) ) 
2667+                         && !self . is_async_gen_block ( ) 
2668+                         // Rule out `const unsafe auto` and `const unsafe trait`.  
2669+                         && !self . is_keyword_ahead ( 2 ,  & [ kw:: Auto ,  kw:: Trait ] ) 
2670+                     ) 
26682671                } ) 
26692672            // `extern ABI fn` 
26702673            || self . check_keyword_case ( exp ! ( Extern ) ,  case) 
Original file line number Diff line number Diff line change 1+ // Test that `const unsafe trait` and `const unsafe auto trait` works. 
2+ 
3+ //@ check-pass 
4+ 
5+ #![ feature( const_trait_impl) ]  
6+ #![ feature( auto_traits) ]  
7+ 
8+ pub  const  unsafe  trait  Owo  { } 
9+ const  unsafe  trait  OwO  { } 
10+ pub  const  unsafe  auto trait  UwU  { } 
11+ const  unsafe  auto trait  Uwu  { } 
12+ 
13+ fn  main ( )  { } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments