Skip to content

Commit fa29aa3

Browse files
committed
Auto merge of rust-lang#17565 - mo8it:remove-version-check, r=Veykril
Remove version check before using `--keep-going` See rust-lang/rust-analyzer#17561 (comment) by `@lnicola`
2 parents 7e3303d + a8e90c8 commit fa29aa3

File tree

2 files changed

+7
-25
lines changed

2 files changed

+7
-25
lines changed

src/tools/rust-analyzer/crates/project-model/src/build_scripts.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use itertools::Itertools;
1818
use la_arena::ArenaMap;
1919
use paths::{AbsPath, AbsPathBuf};
2020
use rustc_hash::{FxHashMap, FxHashSet};
21-
use semver::Version;
2221
use serde::Deserialize;
2322
use toolchain::Tool;
2423

@@ -64,10 +63,8 @@ impl WorkspaceBuildScripts {
6463
config: &CargoConfig,
6564
allowed_features: &FxHashSet<String>,
6665
manifest_path: &ManifestPath,
67-
toolchain: Option<&Version>,
6866
sysroot: &Sysroot,
6967
) -> io::Result<Command> {
70-
const RUST_1_75: Version = Version::new(1, 75, 0);
7168
let mut cmd = match config.run_build_script_command.as_deref() {
7269
Some([program, args @ ..]) => {
7370
let mut cmd = Command::new(program);
@@ -122,9 +119,7 @@ impl WorkspaceBuildScripts {
122119
cmd.arg("-Zscript");
123120
}
124121

125-
if toolchain.map_or(false, |it| *it >= RUST_1_75) {
126-
cmd.arg("--keep-going");
127-
}
122+
cmd.arg("--keep-going");
128123

129124
cmd
130125
}
@@ -148,7 +143,6 @@ impl WorkspaceBuildScripts {
148143
config: &CargoConfig,
149144
workspace: &CargoWorkspace,
150145
progress: &dyn Fn(String),
151-
toolchain: Option<&Version>,
152146
sysroot: &Sysroot,
153147
) -> io::Result<WorkspaceBuildScripts> {
154148
let current_dir = match &config.invocation_location {
@@ -160,13 +154,8 @@ impl WorkspaceBuildScripts {
160154
.as_ref();
161155

162156
let allowed_features = workspace.workspace_features();
163-
let cmd = Self::build_command(
164-
config,
165-
&allowed_features,
166-
workspace.manifest_path(),
167-
toolchain,
168-
sysroot,
169-
)?;
157+
let cmd =
158+
Self::build_command(config, &allowed_features, workspace.manifest_path(), sysroot)?;
170159
Self::run_per_ws(cmd, workspace, current_dir, progress)
171160
}
172161

@@ -194,7 +183,6 @@ impl WorkspaceBuildScripts {
194183
&Default::default(),
195184
// This is not gonna be used anyways, so just construct a dummy here
196185
&ManifestPath::try_from(workspace_root.clone()).unwrap(),
197-
None,
198186
&Sysroot::empty(),
199187
)?;
200188
// NB: Cargo.toml could have been modified between `cargo metadata` and

src/tools/rust-analyzer/crates/project-model/src/workspace.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -450,16 +450,10 @@ impl ProjectWorkspace {
450450
match &self.kind {
451451
ProjectWorkspaceKind::DetachedFile { cargo: Some((cargo, _)), .. }
452452
| ProjectWorkspaceKind::Cargo { cargo, .. } => {
453-
WorkspaceBuildScripts::run_for_workspace(
454-
config,
455-
cargo,
456-
progress,
457-
self.toolchain.as_ref(),
458-
&self.sysroot,
459-
)
460-
.with_context(|| {
461-
format!("Failed to run build scripts for {}", cargo.workspace_root())
462-
})
453+
WorkspaceBuildScripts::run_for_workspace(config, cargo, progress, &self.sysroot)
454+
.with_context(|| {
455+
format!("Failed to run build scripts for {}", cargo.workspace_root())
456+
})
463457
}
464458
ProjectWorkspaceKind::DetachedFile { cargo: None, .. }
465459
| ProjectWorkspaceKind::Json { .. } => Ok(WorkspaceBuildScripts::default()),

0 commit comments

Comments
 (0)