as well. To get the value of any of these variables in a Rust program, do
this:
-```rust
+```rust,ignore
let version = env!("CARGO_PKG_VERSION");
```
are not yet set when the build script is compiled, the above example using `env!` won't work
and instead you'll need to retrieve the values when the build script is run:
-```rust
+```rust,ignore
use std::env;
let out_dir = env::var("OUT_DIR").unwrap();
```
An additional barrier to querying GitHub is that the organization may be
actively denying third party access. To check this, you can go to:
- https://github.com/organizations/:org/settings/oauth_application_policy
+```text
+https://github.com/organizations/:org/settings/oauth_application_policy
+```
where `:org` is the name of the organization (e.g., `rust-lang`). You may see
something like:
that the artifacts are copied, so the originals are still in the `target`
directory. Example:
-```
+```sh
cargo +nightly build --out-dir=out -Z unstable-options
```
`-Zunstable-features --enable-per-target-ignores` and passing along
information from `.cargo/config.toml`. See the rustc issue for more information.
-```
+```sh
cargo test --target foo -Zdoctest-xcompile
```
For example, using `cargo build` with `--profile` and the manifest from above:
-```
+```sh
cargo +nightly build --profile release-lto -Z unstable-options
```
anything. This can be useful when integrating with another build tool.
Example:
-```
+```sh
cargo +nightly build --build-plan -Z unstable-options
```
time the only supported method of doing so is to add the `rust-src` rust rustup
component:
-```
+```console
$ rustup component add rust-src --toolchain nightly
```
Usage looks like:
-```
+```console
$ cargo new foo
$ cd foo
$ cargo +nightly run -Z build-std --target x86_64-unknown-linux-gnu
`test` crate. If you're working with an environment which does not support some
of these crates, then you can pass an argument to `-Zbuild-std` as well:
-```
+```console
$ cargo +nightly build -Z build-std=core,alloc
```
The `timings` feature gives some information about how long each compilation
takes, and tracks concurrency information over time.
-```
+```sh
cargo +nightly build -Z timings
```
Some examples of what it looks like using Bourne shell syntax:
-```sh
+```console
# Most shells will require escaping.
cargo --config http.proxy=\"http://example.com\" …