MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / rustc

Method rustc

crates/test/src/rust.rs:277–301  ·  view source on GitHub ↗
(&self, edition: Edition)

Source from the content-addressed store, hash-verified

275
276impl Runner {
277 fn rustc(&self, edition: Edition) -> Command {
278 let state = self.rust_state.as_ref().unwrap();
279 let opts = &self.opts.rust;
280 let mut cmd = Command::new("rustc");
281 cmd.arg(match edition {
282 Edition::E2021 => "--edition=2021",
283 Edition::E2024 => "--edition=2024",
284 })
285 .arg(&format!(
286 "--extern=wit_bindgen={}",
287 state.wit_bindgen_rlib.display()
288 ))
289 .arg(&format!(
290 "--extern=futures={}",
291 state.futures_rlib.display()
292 ))
293 .arg("--target")
294 .arg(&opts.rust_target)
295 .arg("-Dwarnings")
296 .arg("-Cdebuginfo=1");
297 for dep in state.wit_bindgen_deps.iter() {
298 cmd.arg(&format!("-Ldependency={}", dep.display()));
299 }
300 cmd
301 }
302
303 fn produces_component(&self) -> bool {
304 match self.opts.rust.rust_target.as_str() {

Callers 2

compileMethod · 0.80
verifyMethod · 0.80

Calls 2

newFunction · 0.85
iterMethod · 0.45

Tested by

no test coverage detected