File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,8 +259,12 @@ impl WorldGenerator for C {
259259 " ,
260260 ) ;
261261 }
262-
262+ let version = env ! ( "CARGO_PKG_VERSION" ) ;
263263 let mut h_str = wit_bindgen_core:: Source :: default ( ) ;
264+ uwriteln ! (
265+ h_str,
266+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!"
267+ ) ;
264268
265269 uwrite ! (
266270 h_str,
@@ -283,6 +287,10 @@ impl WorldGenerator for C {
283287 }
284288
285289 let mut c_str = wit_bindgen_core:: Source :: default ( ) ;
290+ uwriteln ! (
291+ c_str,
292+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!"
293+ ) ;
286294 uwriteln ! ( c_str, "#include \" {snake}.h\" " ) ;
287295 if c_str. len ( ) > 0 {
288296 c_str. push_str ( "\n " ) ;
Original file line number Diff line number Diff line change @@ -113,6 +113,11 @@ impl RustWasm {
113113
114114impl WorldGenerator for RustWasm {
115115 fn preprocess ( & mut self , resolve : & Resolve , _world : WorldId ) {
116+ let version = env ! ( "CARGO_PKG_VERSION" ) ;
117+ uwriteln ! (
118+ self . src,
119+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!"
120+ ) ;
116121 self . types . analyze ( resolve) ;
117122 }
118123
Original file line number Diff line number Diff line change @@ -179,7 +179,9 @@ impl WorldGenerator for TeaVmJava {
179179 let package = format ! ( "wit_{}" , world. name. to_snake_case( ) ) ;
180180 let name = world. name . to_upper_camel_case ( ) ;
181181
182+ let version = env ! ( "CARGO_PKG_VERSION" ) ;
182183 let mut src = String :: new ( ) ;
184+ uwriteln ! ( src, "// Generated by `wit-bindgen` {version}. DO NOT EDIT!" ) ;
183185
184186 uwrite ! (
185187 src,
@@ -361,7 +363,8 @@ impl WorldGenerator for TeaVmJava {
361363 . join ( "\n " ) ;
362364
363365 let body = format ! (
364- "package {package};
366+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!
367+ package {package};
365368
366369 {IMPORTS}
367370
@@ -386,7 +389,8 @@ impl WorldGenerator for TeaVmJava {
386389 . join ( "\n " ) ;
387390
388391 let body = format ! (
389- "package {package};
392+ "// Generated by `wit-bindgen` {version}. DO NOT EDIT!
393+ package {package};
390394
391395 {IMPORTS}
392396
You can’t perform that action at this time.
0 commit comments