File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed 
compiler/rustc_error_codes/src/error_codes Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 11` '_ `  lifetime name or ` &T `  without an explicit lifetime name has been used
2- on  illegal place.
2+ in an  illegal place.
33
44Erroneous code example:
55
@@ -13,7 +13,14 @@ fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {
1313    } 
1414} 
1515
16- fn and_without_explicit_lifetime<T>() 
16+ fn without_explicit_lifetime<T>() 
17+ where 
18+     T: Iterator<Item = &u32>, 
19+                      //^ `&` without an explicit lifetime name 
20+ { 
21+ } 
22+ 
23+ fn without_hrtb<T>() 
1724where 
1825    T: Into<&u32>, 
1926          //^ `&` without an explicit lifetime name 
@@ -40,9 +47,15 @@ fn underscore_lifetime<'a>(str1: &'a str, str2: &'a str) -> &'a str {
4047    } 
4148} 
4249
43- fn and_without_explicit_lifetime<'foo, T>() 
50+ fn without_explicit_lifetime<'a, T>() 
51+ where 
52+     T: Iterator<Item = &'a u32>, 
53+ { 
54+ } 
55+ 
56+ fn without_hrtb<T>() 
4457where 
45-     T: Into<&'foo u32>, 
58+     T: for<'foo>  Into<&'foo u32>, 
4659{ 
4760} 
4861``` 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments