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(
170
170
171
171
w. write_line ( "" ) ;
172
172
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
+ }
173
180
174
181
for message in & scope. get_messages ( ) {
175
182
// 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 = "";
85
85
/// This symbol is in generated `version.rs`, include here for IDE
86
86
#[ cfg( never) ]
87
87
#[ doc( hidden) ]
88
- pub const VERSION_SYMBOL : & str = "" ;
88
+ pub const VERSION_IDENT : & str = "" ;
89
89
include ! ( concat!( env!( "OUT_DIR" ) , "/version.rs" ) ) ;
You can’t perform that action at this time.
0 commit comments