File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,13 @@ fn gen_file(
170170
171171        w. write_line ( "" ) ; 
172172        w. write_line ( & format ! ( "//! Generated file from `{}`" ,  file. get_name( ) ) ) ; 
173+         if  customize. inside_protobuf  != Some ( true )  { 
174+             w. write_line ( "" ) ; 
175+             w. write_line ( "/// Generated files are compatible only with the same version" ) ; 
176+             w. write_line ( "/// of protobuf runtime." ) ; 
177+             w. write_line ( & format ! ( "const _PROTOBUF_VERSION_CHECK: () = {}::{};" , 
178+                 protobuf_crate_path( & customize) ,  protobuf:: VERSION_IDENT ) ) ; 
179+         } 
173180
174181        for  message in  & scope. get_messages ( )  { 
175182            // ignore map entries, because they are not used in map fields 
Original file line number Diff line number Diff line change @@ -85,5 +85,5 @@ pub const VERSION: &str = "";
8585/// This symbol is in generated `version.rs`, include here for IDE 
8686#[ cfg( never) ]  
8787#[ doc( hidden) ]  
88- pub  const  VERSION_SYMBOL :  & str  = "" ; 
88+ pub  const  VERSION_IDENT :  & str  = "" ; 
8989include ! ( concat!( env!( "OUT_DIR" ) ,  "/version.rs" ) ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments