File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/tools/rust-analyzer/xtask/src Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,11 @@ pub(crate) struct ServerOpt {
4444
4545impl 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 {
You can’t perform that action at this time.
0 commit comments