Skip to content

Commit 5dbb376

Browse files
authored
Merge pull request #21161 from itsjunetime/no_default_force_always_assert
Remove force-always-assert from xtask/install install_cmd as well
2 parents 86e1529 + a8d8847 commit 5dbb376

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/tools/rust-analyzer/xtask/src/install.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ pub(crate) struct ServerOpt {
4444

4545
impl ServerOpt {
4646
fn to_features(&self) -> Vec<&'static str> {
47-
let mut features = Vec::new();
48-
features.extend(self.malloc.to_features());
47+
let malloc_features = self.malloc.to_features();
48+
let mut features = Vec::with_capacity(
49+
malloc_features.len() + if self.force_always_assert { 2 } else { 0 },
50+
);
51+
features.extend(malloc_features);
4952
if self.force_always_assert {
5053
features.extend(["--features", "force-always-assert"]);
5154
}
@@ -153,7 +156,7 @@ fn install_server(sh: &Shell, opts: ServerOpt) -> anyhow::Result<()> {
153156

154157
let mut install_cmd = cmd!(
155158
sh,
156-
"cargo install --path crates/rust-analyzer --profile={profile} --locked --force --features force-always-assert {features...}"
159+
"cargo install --path crates/rust-analyzer --profile={profile} --locked --force {features...}"
157160
);
158161

159162
if let Some(train_crate) = opts.pgo {

0 commit comments

Comments
 (0)