Skip to main content

gen_staged_trybuild

Function gen_staged_trybuild 

Source
pub fn gen_staged_trybuild(
    lib_path: &Path,
    manifest_path: &Path,
    orig_crate_path: &str,
    test_mode_feature: Option<String>,
) -> File
Expand description

Generates the contents for __staged when it will be emitted in “trybuild mode”, which means that it is included inline next to the spliced code that uses it, with the original crate available as a dependency.

§Arguments

  • lib_path - path to the root Rust file, usually to lib.rs.
  • manifest_path - path to the package Cargo.toml.
  • orig_crate_path - Rust module path to the staged crate. Usually crate, but may be the staged crate name if the entry and staged crate/target are different.
  • test_mode_feature - If Some("FEATURE"), #[cfg(test)] modules will be gated with #[cfg(feature = "FEATURE")] instead of being fully removed.