@@ -46,12 +46,26 @@ If a [toolchain file](https://rust-lang.github.io/rustup/overrides.html#the-tool
46
46
First, all items specified in the toolchain file are installed.
47
47
Afterward, the `components` and `target` specified via inputs are installed in addition to the items from the toolchain file.
48
48
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].
55
69
56
70
# # Outputs
57
71
@@ -68,3 +82,4 @@ License].
68
82
69
83
[MIT License] : LICENSE
70
84
[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