Auto merge of #10550 - phil-opp:bindeps-doc-fix, r=weihanglo

Fix docs: Bindeps env vars are passed to build script at runtime

The environment variables are not available through the `env!` macro. Instead, they are passed by cargo when the build script is invoked.

The current test suite confirms this:

fc5035d698/tests/testsuite/artifact_dep.rs (L524-L548)
This commit is contained in:
bors 2022-04-09 10:48:19 +00:00
commit 4777c22168

View File

@ -886,7 +886,7 @@ bar = { artifact = "cdylib", version = "1.0", target = "wasm32-unknown-unknown"
```rust
fn main() {
wasm::run_file(env!("CARGO_CDYLIB_FILE_BAR"));
wasm::run_file(std::env::var("CARGO_CDYLIB_FILE_BAR").unwrap());
}
```