Skip to content

Commit 9bcb212

Browse files
committed
remove box_syntax
Box syntax removed in rust-lang/rust#108471 Removed all `#![features(box_syntax)]` and ran `cargo fix --broken-code` to replace all previous box_patterns uses of `box` with `Box::new()`.
1 parent 9066c95 commit 9bcb212

File tree

29 files changed

+177
-184
lines changed

29 files changed

+177
-184
lines changed

crates/turbo-tasks-fs/src/lib.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(min_specialization)]
44
#![feature(iter_advance_by)]
55
#![feature(io_error_more)]
6-
#![feature(box_syntax)]
76
#![feature(round_char_boundary)]
87

98
pub mod attach;
@@ -1684,7 +1683,7 @@ impl FileContent {
16841683
match serde_path_to_error::deserialize(de) {
16851684
Ok(data) => FileJsonContent::Content(data),
16861685
Err(e) => FileJsonContent::Unparseable(
1687-
box UnparseableJson::from_serde_path_to_error(e),
1686+
Box::new(UnparseableJson::from_serde_path_to_error(e)),
16881687
),
16891688
}
16901689
}
@@ -1709,10 +1708,10 @@ impl FileContent {
17091708
"text content doesn't contain any json data",
17101709
),
17111710
},
1712-
Err(e) => FileJsonContent::Unparseable(box UnparseableJson::from_jsonc_error(
1711+
Err(e) => FileJsonContent::Unparseable(Box::new(UnparseableJson::from_jsonc_error(
17131712
e,
17141713
string.as_ref(),
1715-
)),
1714+
))),
17161715
},
17171716
Err(_) => FileJsonContent::unparseable("binary is not valid utf-8 text"),
17181717
},

crates/turbo-tasks-memory/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(hash_drain_filter)]
22
#![feature(option_get_or_insert_default)]
3-
#![feature(box_syntax)]
43
#![feature(type_alias_impl_trait)]
54
#![feature(lint_reasons)]
65
#![feature(box_patterns)]

crates/turbo-tasks-memory/src/task.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,10 @@ impl Task {
528528
Self {
529529
id,
530530
ty,
531-
state: RwLock::new(TaskMetaState::Full(box TaskState::new(
531+
state: RwLock::new(TaskMetaState::Full(Box::new(TaskState::new(
532532
description,
533533
stats_type,
534-
))),
534+
)))),
535535
}
536536
}
537537

@@ -546,11 +546,11 @@ impl Task {
546546
Self {
547547
id,
548548
ty,
549-
state: RwLock::new(TaskMetaState::Full(box TaskState::new_scheduled_in_scope(
549+
state: RwLock::new(TaskMetaState::Full(Box::new(TaskState::new_scheduled_in_scope(
550550
description,
551551
scope,
552552
stats_type,
553-
))),
553+
)))),
554554
}
555555
}
556556

@@ -565,11 +565,11 @@ impl Task {
565565
Self {
566566
id,
567567
ty,
568-
state: RwLock::new(TaskMetaState::Full(box TaskState::new_scheduled_in_scope(
568+
state: RwLock::new(TaskMetaState::Full(Box::new(TaskState::new_scheduled_in_scope(
569569
description,
570570
scope,
571571
stats_type,
572-
))),
572+
)))),
573573
}
574574
}
575575

@@ -579,18 +579,18 @@ impl Task {
579579
trait_type_id: TraitTypeId,
580580
stats_type: StatsType,
581581
) -> Self {
582-
let ty = TaskType::ReadScopeCollectibles(box ReadScopeCollectiblesTaskType {
582+
let ty = TaskType::ReadScopeCollectibles(Box::new(ReadScopeCollectiblesTaskType {
583583
scope: target_scope,
584584
trait_type: trait_type_id,
585-
});
585+
}));
586586
let description = Self::get_event_description_static(id, &ty);
587587
Self {
588588
id,
589589
ty,
590-
state: RwLock::new(TaskMetaState::Full(box TaskState::new(
590+
state: RwLock::new(TaskMetaState::Full(Box::new(TaskState::new(
591591
description,
592592
stats_type,
593-
))),
593+
)))),
594594
}
595595
}
596596

@@ -601,19 +601,19 @@ impl Task {
601601
trait_type_id: TraitTypeId,
602602
stats_type: StatsType,
603603
) -> Self {
604-
let ty = TaskType::ReadTaskCollectibles(box ReadTaskCollectiblesTaskType {
604+
let ty = TaskType::ReadTaskCollectibles(Box::new(ReadTaskCollectiblesTaskType {
605605
task: target_task,
606606
trait_type: trait_type_id,
607-
});
607+
}));
608608
let description = Self::get_event_description_static(id, &ty);
609609
Self {
610610
id,
611611
ty,
612-
state: RwLock::new(TaskMetaState::Full(box TaskState::new_root_scoped(
612+
state: RwLock::new(TaskMetaState::Full(Box::new(TaskState::new_root_scoped(
613613
description,
614614
scope,
615615
stats_type,
616-
))),
616+
)))),
617617
}
618618
}
619619

@@ -2787,7 +2787,7 @@ impl Task {
27872787
if unset {
27882788
*state = TaskMetaState::Unloaded(UnloadedTaskState { stats_type });
27892789
} else {
2790-
*state = TaskMetaState::Partial(box PartialTaskState { scopes, stats_type });
2790+
*state = TaskMetaState::Partial(Box::new(PartialTaskState { scopes, stats_type }));
27912791
}
27922792
drop(state);
27932793

crates/turbo-tasks-memory/src/task/meta_state.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl<'a> TaskMetaStateWriteGuard<'a> {
187187
)
188188
.into_partial()
189189
.unwrap();
190-
*guard = TaskMetaState::Full(box partial.into_full(task.get_event_description()));
190+
*guard = TaskMetaState::Full(Box::new(partial.into_full(task.get_event_description())));
191191
}
192192
TaskMetaState::Unloaded(_) => {
193193
let unloaded = replace(
@@ -199,7 +199,7 @@ impl<'a> TaskMetaStateWriteGuard<'a> {
199199
)
200200
.into_unloaded()
201201
.unwrap();
202-
*guard = TaskMetaState::Full(box unloaded.into_full(task.get_event_description()));
202+
*guard = TaskMetaState::Full(Box::new(unloaded.into_full(task.get_event_description())));
203203
}
204204
}
205205
WriteGuard::new(guard, TaskMetaState::as_full, TaskMetaState::as_full_mut)
@@ -228,7 +228,7 @@ impl<'a> TaskMetaStateWriteGuard<'a> {
228228
)
229229
.into_unloaded()
230230
.unwrap();
231-
*guard = TaskMetaState::Partial(box unloaded.into_partial());
231+
*guard = TaskMetaState::Partial(Box::new(unloaded.into_partial()));
232232
TaskMetaStateWriteGuard::Partial(WriteGuard::new(
233233
guard,
234234
TaskMetaState::as_partial,

crates/turbo-tasks-testing/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Testing utilities and macros for turbo-tasks and applications based on it.
22
3-
#![feature(box_syntax)]
43

54
mod macros;
65
pub mod retry;

crates/turbo-tasks/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#![feature(hash_drain_filter)]
2929
#![deny(unsafe_op_in_unsafe_fn)]
3030
#![feature(result_flattening)]
31-
#![feature(box_syntax)]
3231
#![feature(error_generic_member_access)]
3332
#![feature(provide_any)]
3433
#![feature(new_uninit)]

crates/turbopack-css/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(min_specialization)]
22
#![feature(box_patterns)]
3-
#![feature(box_syntax)]
43
#![feature(iter_intersperse)]
54
#![feature(int_roundings)]
65

crates/turbopack-ecmascript/src/analyzer/builtin.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
7474
*value = JsValue::alternatives(
7575
take(alts)
7676
.into_iter()
77-
.map(|alt| JsValue::member(box alt, prop.clone()))
77+
.map(|alt| JsValue::member(Box::new(alt), prop.clone()))
7878
.collect(),
7979
);
8080
true
@@ -87,7 +87,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
8787
} => {
8888
fn items_to_alternatives(items: &mut Vec<JsValue>, prop: &mut JsValue) -> JsValue {
8989
items.push(JsValue::unknown(
90-
JsValue::member(box JsValue::array(Vec::new()), box take(prop)),
90+
JsValue::member(Box::new(JsValue::array(Vec::new())), Box::new(take(prop))),
9191
"unknown array prototype methods or values",
9292
));
9393
JsValue::alternatives(take(items))
@@ -105,7 +105,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
105105
true
106106
} else {
107107
*value = JsValue::unknown(
108-
JsValue::member(box take(obj), box take(prop)),
108+
JsValue::member(Box::new(take(obj)), Box::new(take(prop))),
109109
"invalid index",
110110
);
111111
true
@@ -127,7 +127,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
127127
*value = JsValue::alternatives(
128128
take(alts)
129129
.into_iter()
130-
.map(|alt| JsValue::member(box obj.clone(), box alt))
130+
.map(|alt| JsValue::member(Box::new(obj.clone()), Box::new(alt)))
131131
.collect(),
132132
);
133133
true
@@ -160,7 +160,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
160160
ObjectPart::Spread(_) => {
161161
values.push(JsValue::unknown(
162162
JsValue::member(
163-
box JsValue::object(vec![take(part)]),
163+
Box::new(JsValue::object(vec![take(part)])),
164164
prop.clone(),
165165
),
166166
"spreaded object",
@@ -170,7 +170,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
170170
}
171171
if include_unknown {
172172
values.push(JsValue::unknown(
173-
JsValue::member(box JsValue::object(Vec::new()), box take(prop)),
173+
JsValue::member(Box::new(JsValue::object(Vec::new())), Box::new(take(prop))),
174174
"unknown object prototype methods or values",
175175
));
176176
}
@@ -262,7 +262,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
262262
*value = JsValue::alternatives(
263263
take(alts)
264264
.into_iter()
265-
.map(|alt| JsValue::member(box obj.clone(), box alt))
265+
.map(|alt| JsValue::member(Box::new(obj.clone()), Box::new(alt)))
266266
.collect(),
267267
);
268268
true
@@ -336,7 +336,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
336336
.enumerate()
337337
.map(|(i, item)| {
338338
JsValue::call(
339-
box func.clone(),
339+
Box::new(func.clone()),
340340
vec![
341341
item,
342342
JsValue::Constant(ConstantValue::Num(
@@ -361,7 +361,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
361361
take(alts)
362362
.into_iter()
363363
.map(|alt| {
364-
JsValue::member_call(box alt, box prop.clone(), args.clone())
364+
JsValue::member_call(Box::new(alt), Box::new(prop.clone()), args.clone())
365365
})
366366
.collect(),
367367
);
@@ -372,7 +372,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
372372
// without special handling, we convert it into a normal call like
373373
// `(obj.prop)(arg1, arg2, ...)`
374374
*value = JsValue::call(
375-
box JsValue::member(box take(obj), box take(prop)),
375+
Box::new(JsValue::member(Box::new(take(obj)), Box::new(take(prop)))),
376376
take(args),
377377
);
378378
true
@@ -383,7 +383,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
383383
*value = JsValue::alternatives(
384384
take(alts)
385385
.into_iter()
386-
.map(|alt| JsValue::call(box alt, args.clone()))
386+
.map(|alt| JsValue::call(Box::new(alt), args.clone()))
387387
.collect(),
388388
);
389389
true

0 commit comments

Comments
 (0)