Skip to content

Commit

Permalink
Auto merge of #10550 - phil-opp:bindeps-doc-fix, r=weihanglo
Browse files Browse the repository at this point in the history
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:

https://github.com/rust-lang/cargo/blob/fc5035d6980701c71c2ce3714e3ff239b19013b2/tests/testsuite/artifact_dep.rs#L524-L548
  • Loading branch information
bors committed Apr 9, 2022
2 parents fc5035d + 90f6a99 commit 4777c22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
```

Expand Down

0 comments on commit 4777c22

Please sign in to comment.