@@ -46,12 +46,26 @@ If a [toolchain file](https://rust-lang.github.io/rustup/overrides.html#the-tool
4646First, all items specified in the toolchain file are installed.
4747Afterward, the `components` and `target` specified via inputs are installed in addition to the items from the toolchain file.
4848
49- | Name | Description | Default |
50- | ------------ | --------------------------------------------------------------------------------- | ------- |
51- | `toolchain` | Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. | stable |
52- | `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | |
53- | `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | |
54- | `cache` | Automatically configure Rust cache (using `Swatinem/rust-cache`) | true |
49+ | Name | Description | Default |
50+ | ------------ | -------------------------------------------------------------------------------------- | ------------- |
51+ | `toolchain` | Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. | stable |
52+ | `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | |
53+ | `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | |
54+ | `cache` | Automatically configure Rust cache (using `Swatinem/rust-cache`) | true |
55+ | `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
56+
57+ # ## RUSTFLAGS
58+
59+ By default, this action sets the `RUSTFLAGS` environment variable to `-D warnings`.
60+
61+ However, rustflags sources are mutually exclusive, so setting this environment
62+ variable omits any configuration through `target.*.rustflags` or
63+ ` build.rustflags` .
64+
65+ To prevent this from happening, set the `rustflags` input to an empty string, which will
66+ prevent the action from setting `RUSTFLAGS` at all, keeping any existing preferences.
67+
68+ You can read more rustflags, and their load order, in the [Cargo reference].
5569
5670# # Outputs
5771
@@ -68,3 +82,4 @@ License].
6882
6983[MIT License] : LICENSE
7084[Problem Matchers] : https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md
85+ [Cargo reference] : https://doc.rust-lang.org/cargo/reference/config.html?highlight=unknown#buildrustflags
0 commit comments