File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed 
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1- This error indicates that a variable usage inside an inner function is invalid
2- because the variable comes from a dynamic environment. Inner functions do not
3- have access to their containing environment.
1+ A variable used inside an inner function comes from a dynamic environment.
42
53Erroneous code example:
64
@@ -14,8 +12,8 @@ fn foo() {
1412} 
1513``` 
1614
17- Functions  do not capture local variables . To fix this error, you can replace the 
18- function with a closure:
15+ Inner functions  do not have access to their containing environment . To fix this
16+ error, you can replace the  function with a closure:
1917
2018``` 
2119fn foo() { 
@@ -26,7 +24,7 @@ fn foo() {
2624} 
2725``` 
2826
29- or  replace the captured variable with a constant or a static item:
27+ Or  replace the captured variable with a constant or a static item:
3028
3129``` 
3230fn foo() { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments