(&mut self, resolve: &Resolve, world: WorldId)
| 1070 | |
| 1071 | impl WorldGenerator for RustWasm { |
| 1072 | fn preprocess(&mut self, resolve: &Resolve, world: WorldId) { |
| 1073 | wit_bindgen_core::generated_preamble(&mut self.src_preamble, env!("CARGO_PKG_VERSION")); |
| 1074 | |
| 1075 | // Render some generator options to assist with debugging and/or to help |
| 1076 | // recreate it if the original generation command is lost. |
| 1077 | uwriteln!(self.src_preamble, "// Options used:"); |
| 1078 | if self.opts.std_feature { |
| 1079 | uwriteln!(self.src_preamble, "// * std_feature"); |
| 1080 | } |
| 1081 | if self.opts.raw_strings { |
| 1082 | uwriteln!(self.src_preamble, "// * raw_strings"); |
| 1083 | } |
| 1084 | if !self.opts.skip.is_empty() { |
| 1085 | uwriteln!(self.src_preamble, "// * skip: {:?}", self.opts.skip); |
| 1086 | } |
| 1087 | if self.opts.stubs { |
| 1088 | uwriteln!(self.src_preamble, "// * stubs"); |
| 1089 | } |
| 1090 | if let Some(export_prefix) = &self.opts.export_prefix { |
| 1091 | uwriteln!( |
| 1092 | self.src_preamble, |
| 1093 | "// * export_prefix: {:?}", |
| 1094 | export_prefix |
| 1095 | ); |
| 1096 | } |
| 1097 | if let Some(runtime_path) = &self.opts.runtime_path { |
| 1098 | uwriteln!(self.src_preamble, "// * runtime_path: {:?}", runtime_path); |
| 1099 | } |
| 1100 | if let Some(map_type) = &self.opts.map_type { |
| 1101 | uwriteln!(self.src_preamble, "// * map_type: {:?}", map_type); |
| 1102 | } |
| 1103 | if let Some(bitflags_path) = &self.opts.bitflags_path { |
| 1104 | uwriteln!( |
| 1105 | self.src_preamble, |
| 1106 | "// * bitflags_path: {:?}", |
| 1107 | bitflags_path |
| 1108 | ); |
| 1109 | } |
| 1110 | if !matches!(self.opts.ownership, Ownership::Owning) { |
| 1111 | uwriteln!( |
| 1112 | self.src_preamble, |
| 1113 | "// * ownership: {:?}", |
| 1114 | self.opts.ownership |
| 1115 | ); |
| 1116 | } |
| 1117 | if !self.opts.additional_derive_attributes.is_empty() { |
| 1118 | uwriteln!( |
| 1119 | self.src_preamble, |
| 1120 | "// * additional derives {:?}", |
| 1121 | self.opts.additional_derive_attributes |
| 1122 | ); |
| 1123 | } |
| 1124 | if !self.opts.additional_derive_ignore.is_empty() { |
| 1125 | uwriteln!( |
| 1126 | self.src_preamble, |
| 1127 | "// * additional derives ignored {:?}", |
| 1128 | self.opts.additional_derive_ignore |
| 1129 | ); |
nothing calls this directly
no test coverage detected