File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/tools/rust-analyzer/crates Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,13 @@ impl CfgOptions {
115115 pub fn shrink_to_fit ( & mut self ) {
116116 self . enabled . shrink_to_fit ( ) ;
117117 }
118+
119+ pub fn append ( & mut self , other : CfgOptions ) {
120+ // Do not call `insert_any_atom()`, as it'll check for `true` and `false`, but this is not
121+ // needed since we already checked for that when constructing `other`. Furthermore, this
122+ // will always err, as `other` inevitably contains `true` (just as we do).
123+ self . enabled . extend ( other. enabled ) ;
124+ }
118125}
119126
120127impl Extend < CfgAtom > for CfgOptions {
Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ impl ChangeFixture {
252252 assert ! ( default_crate_root. is_none( ) ) ;
253253 default_crate_root = Some ( file_id) ;
254254 default_edition = meta. edition ;
255- default_cfg. extend ( meta. cfg . into_iter ( ) ) ;
255+ default_cfg. append ( meta. cfg ) ;
256256 default_env. extend_from_other ( & meta. env ) ;
257257 }
258258
You can’t perform that action at this time.
0 commit comments