Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit bec14e8

Browse files
committed
Make build_lib, build_bin, and cfg_test unstable
And change the default of all_targets to true
1 parent 827c96c commit bec14e8

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ project.
9393

9494
Currently we accept the following options:
9595

96-
* `build_lib` (`bool`, defaults to `false`) checks the project as if you passed
97-
the `--lib` argument to cargo. Mutually exclusive with, and preferred over,
98-
`build_bin`.
99-
* `build_bin` (`String`, defaults to `""`) checks the project as if you passed
100-
`-- bin <build_bin>` argument to cargo. Mutually exclusive with `build_lib`.
101-
* `cfg_test` (`bool`, defaults to `false`) checks the project as if you were
102-
running `cargo test` rather than `cargo build`. I.e., compiles (but does not
103-
run) test code.
10496
* `unstable_features` (`bool`, defaults to `false`) enables unstable features.
10597
Currently no option requires this flag.
10698
* `sysroot` (`String`, defaults to `""`) if the given string is not empty, use
@@ -110,7 +102,7 @@ Currently we accept the following options:
110102
the given target triple for all rustc invocations
111103
* `wait_to_build` (`u64`, defaults to `1500`) time in milliseconds between
112104
receiving a change notification and starting build
113-
* `all_targets` (`bool`, defaults to `false`) checks the project as if you were
105+
* `all_targets` (`bool`, defaults to `true`) checks the project as if you were
114106
running `cargo check --all-targets`. I.e., check all targets and integration
115107
tests too
116108
* `use_crate_blacklist` (`bool`, defaults to `true`) if disabled, also indexes
@@ -129,6 +121,18 @@ Currently we accept the following options:
129121
- `"opt-in"` Clippy lints are shown when crates specify `#![warn(clippy)]`.
130122
- `"on"` Clippy lints enabled for all crates in workspace.
131123

124+
and the following unstable options:
125+
126+
* `build_lib` (`bool`, defaults to `false`) checks the project as if you passed
127+
the `--lib` argument to cargo. Mutually exclusive with, and preferred over,
128+
`build_bin`.
129+
* `build_bin` (`String`, defaults to `""`) checks the project as if you passed
130+
`-- bin <build_bin>` argument to cargo. Mutually exclusive with `build_lib`.
131+
* `cfg_test` (`bool`, defaults to `false`) checks the project as if you were
132+
running `cargo test` rather than `cargo build`. I.e., compiles (but does not
133+
run) test code.
134+
135+
132136
## Troubleshooting
133137

134138
For tips on debugging and troubleshooting, see [debugging.md](debugging.md).

src/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl Default for Config {
170170
all_features: false,
171171
no_default_features: false,
172172
jobs: None,
173-
all_targets: false,
173+
all_targets: true,
174174
racer_completion: true,
175175
clippy_preference: ClippyPreference::OptIn,
176176
};
@@ -182,6 +182,7 @@ impl Default for Config {
182182
impl Config {
183183
/// Join this configuration with the new config.
184184
pub fn update(&mut self, mut new: Config) {
185+
new.normalise();
185186
new.target_dir = self.target_dir.combine_with_default(&new.target_dir, None);
186187
new.build_lib = self.build_lib.combine_with_default(&new.build_lib, false);
187188
new.build_bin = self.build_bin.combine_with_default(&new.build_bin, None);
@@ -208,6 +209,9 @@ impl Config {
208209

209210
if !self.unstable_features {
210211
// Force-set any unstable features here.
212+
self.build_bin = Inferrable::Inferred(None);
213+
self.build_lib = Inferrable::Inferred(false);
214+
self.cfg_test = false;
211215
}
212216
}
213217

0 commit comments

Comments
 (0)