Skip to content

Commit 92e65d5

Browse files
authored
Upgrade to Rust 1.88 (#19825)
1 parent 35f1af5 commit 92e65d5

File tree

52 files changed

+165
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+165
-184
lines changed

benches/benches/bevy_ecs/events/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ fn send(c: &mut Criterion) {
1010
group.warm_up_time(core::time::Duration::from_millis(500));
1111
group.measurement_time(core::time::Duration::from_secs(4));
1212
for count in [100, 1_000, 10_000] {
13-
group.bench_function(format!("size_4_events_{}", count), |b| {
13+
group.bench_function(format!("size_4_events_{count}"), |b| {
1414
let mut bench = send::Benchmark::<4>::new(count);
1515
b.iter(move || bench.run());
1616
});
1717
}
1818
for count in [100, 1_000, 10_000] {
19-
group.bench_function(format!("size_16_events_{}", count), |b| {
19+
group.bench_function(format!("size_16_events_{count}"), |b| {
2020
let mut bench = send::Benchmark::<16>::new(count);
2121
b.iter(move || bench.run());
2222
});
2323
}
2424
for count in [100, 1_000, 10_000] {
25-
group.bench_function(format!("size_512_events_{}", count), |b| {
25+
group.bench_function(format!("size_512_events_{count}"), |b| {
2626
let mut bench = send::Benchmark::<512>::new(count);
2727
b.iter(move || bench.run());
2828
});
@@ -35,19 +35,19 @@ fn iter(c: &mut Criterion) {
3535
group.warm_up_time(core::time::Duration::from_millis(500));
3636
group.measurement_time(core::time::Duration::from_secs(4));
3737
for count in [100, 1_000, 10_000] {
38-
group.bench_function(format!("size_4_events_{}", count), |b| {
38+
group.bench_function(format!("size_4_events_{count}"), |b| {
3939
let mut bench = iter::Benchmark::<4>::new(count);
4040
b.iter(move || bench.run());
4141
});
4242
}
4343
for count in [100, 1_000, 10_000] {
44-
group.bench_function(format!("size_16_events_{}", count), |b| {
44+
group.bench_function(format!("size_16_events_{count}"), |b| {
4545
let mut bench = iter::Benchmark::<4>::new(count);
4646
b.iter(move || bench.run());
4747
});
4848
}
4949
for count in [100, 1_000, 10_000] {
50-
group.bench_function(format!("size_512_events_{}", count), |b| {
50+
group.bench_function(format!("size_512_events_{count}"), |b| {
5151
let mut bench = iter::Benchmark::<512>::new(count);
5252
b.iter(move || bench.run());
5353
});

benches/benches/bevy_ecs/iteration/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn par_iter_simple(c: &mut Criterion) {
130130
group.warm_up_time(core::time::Duration::from_millis(500));
131131
group.measurement_time(core::time::Duration::from_secs(4));
132132
for f in [0, 10, 100, 1000] {
133-
group.bench_function(format!("with_{}_fragment", f), |b| {
133+
group.bench_function(format!("with_{f}_fragment"), |b| {
134134
let mut bench = par_iter_simple::Benchmark::new(f);
135135
b.iter(move || bench.run());
136136
});

benches/benches/bevy_ecs/scheduling/run_condition.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn run_condition_yes(criterion: &mut Criterion) {
2424
}
2525
// run once to initialize systems
2626
schedule.run(&mut world);
27-
group.bench_function(format!("{}_systems", amount), |bencher| {
27+
group.bench_function(format!("{amount}_systems"), |bencher| {
2828
bencher.iter(|| {
2929
schedule.run(&mut world);
3030
});
@@ -46,7 +46,7 @@ pub fn run_condition_no(criterion: &mut Criterion) {
4646
}
4747
// run once to initialize systems
4848
schedule.run(&mut world);
49-
group.bench_function(format!("{}_systems", amount), |bencher| {
49+
group.bench_function(format!("{amount}_systems"), |bencher| {
5050
bencher.iter(|| {
5151
schedule.run(&mut world);
5252
});
@@ -77,7 +77,7 @@ pub fn run_condition_yes_with_query(criterion: &mut Criterion) {
7777
}
7878
// run once to initialize systems
7979
schedule.run(&mut world);
80-
group.bench_function(format!("{}_systems", amount), |bencher| {
80+
group.bench_function(format!("{amount}_systems"), |bencher| {
8181
bencher.iter(|| {
8282
schedule.run(&mut world);
8383
});
@@ -105,7 +105,7 @@ pub fn run_condition_yes_with_resource(criterion: &mut Criterion) {
105105
}
106106
// run once to initialize systems
107107
schedule.run(&mut world);
108-
group.bench_function(format!("{}_systems", amount), |bencher| {
108+
group.bench_function(format!("{amount}_systems"), |bencher| {
109109
bencher.iter(|| {
110110
schedule.run(&mut world);
111111
});

benches/benches/bevy_ecs/scheduling/running_systems.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn empty_systems(criterion: &mut Criterion) {
2626
schedule.add_systems(empty);
2727
}
2828
schedule.run(&mut world);
29-
group.bench_function(format!("{}_systems", amount), |bencher| {
29+
group.bench_function(format!("{amount}_systems"), |bencher| {
3030
bencher.iter(|| {
3131
schedule.run(&mut world);
3232
});
@@ -38,7 +38,7 @@ pub fn empty_systems(criterion: &mut Criterion) {
3838
schedule.add_systems((empty, empty, empty, empty, empty));
3939
}
4040
schedule.run(&mut world);
41-
group.bench_function(format!("{}_systems", amount), |bencher| {
41+
group.bench_function(format!("{amount}_systems"), |bencher| {
4242
bencher.iter(|| {
4343
schedule.run(&mut world);
4444
});
@@ -79,10 +79,7 @@ pub fn busy_systems(criterion: &mut Criterion) {
7979
}
8080
schedule.run(&mut world);
8181
group.bench_function(
82-
format!(
83-
"{:02}x_entities_{:02}_systems",
84-
entity_bunches, system_amount
85-
),
82+
format!("{entity_bunches:02}x_entities_{system_amount:02}_systems"),
8683
|bencher| {
8784
bencher.iter(|| {
8885
schedule.run(&mut world);
@@ -128,10 +125,7 @@ pub fn contrived(criterion: &mut Criterion) {
128125
}
129126
schedule.run(&mut world);
130127
group.bench_function(
131-
format!(
132-
"{:02}x_entities_{:02}_systems",
133-
entity_bunches, system_amount
134-
),
128+
format!("{entity_bunches:02}x_entities_{system_amount:02}_systems"),
135129
|bencher| {
136130
bencher.iter(|| {
137131
schedule.run(&mut world);

benches/benches/bevy_ecs/world/commands.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn spawn_commands(criterion: &mut Criterion) {
3737
group.measurement_time(core::time::Duration::from_secs(4));
3838

3939
for entity_count in [100, 1_000, 10_000] {
40-
group.bench_function(format!("{}_entities", entity_count), |bencher| {
40+
group.bench_function(format!("{entity_count}_entities"), |bencher| {
4141
let mut world = World::default();
4242
let mut command_queue = CommandQueue::default();
4343

@@ -68,7 +68,7 @@ pub fn nonempty_spawn_commands(criterion: &mut Criterion) {
6868
group.measurement_time(core::time::Duration::from_secs(4));
6969

7070
for entity_count in [100, 1_000, 10_000] {
71-
group.bench_function(format!("{}_entities", entity_count), |bencher| {
71+
group.bench_function(format!("{entity_count}_entities"), |bencher| {
7272
let mut world = World::default();
7373
let mut command_queue = CommandQueue::default();
7474

@@ -162,7 +162,7 @@ pub fn fake_commands(criterion: &mut Criterion) {
162162
group.measurement_time(core::time::Duration::from_secs(4));
163163

164164
for command_count in [100, 1_000, 10_000] {
165-
group.bench_function(format!("{}_commands", command_count), |bencher| {
165+
group.bench_function(format!("{command_count}_commands"), |bencher| {
166166
let mut world = World::default();
167167
let mut command_queue = CommandQueue::default();
168168

@@ -207,7 +207,7 @@ pub fn sized_commands_impl<T: Default + Command>(criterion: &mut Criterion) {
207207
group.measurement_time(core::time::Duration::from_secs(4));
208208

209209
for command_count in [100, 1_000, 10_000] {
210-
group.bench_function(format!("{}_commands", command_count), |bencher| {
210+
group.bench_function(format!("{command_count}_commands"), |bencher| {
211211
let mut world = World::default();
212212
let mut command_queue = CommandQueue::default();
213213

benches/benches/bevy_ecs/world/despawn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn world_despawn(criterion: &mut Criterion) {
1313
group.measurement_time(core::time::Duration::from_secs(4));
1414

1515
for entity_count in [1, 100, 10_000] {
16-
group.bench_function(format!("{}_entities", entity_count), |bencher| {
16+
group.bench_function(format!("{entity_count}_entities"), |bencher| {
1717
bencher.iter_batched_ref(
1818
|| {
1919
let mut world = World::default();

benches/benches/bevy_ecs/world/despawn_recursive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn world_despawn_recursive(criterion: &mut Criterion) {
1313
group.measurement_time(core::time::Duration::from_secs(4));
1414

1515
for entity_count in [1, 100, 10_000] {
16-
group.bench_function(format!("{}_entities", entity_count), |bencher| {
16+
group.bench_function(format!("{entity_count}_entities"), |bencher| {
1717
bencher.iter_batched_ref(
1818
|| {
1919
let mut world = World::default();

benches/benches/bevy_ecs/world/spawn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn world_spawn(criterion: &mut Criterion) {
1313
group.measurement_time(core::time::Duration::from_secs(4));
1414

1515
for entity_count in [1, 100, 10_000] {
16-
group.bench_function(format!("{}_entities", entity_count), |bencher| {
16+
group.bench_function(format!("{entity_count}_entities"), |bencher| {
1717
let mut world = World::default();
1818
bencher.iter(|| {
1919
for _ in 0..entity_count {

benches/benches/bevy_ecs/world/world_get.rs

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn world_entity(criterion: &mut Criterion) {
4949
group.measurement_time(core::time::Duration::from_secs(4));
5050

5151
for entity_count in RANGE.map(|i| i * 10_000) {
52-
group.bench_function(format!("{}_entities", entity_count), |bencher| {
52+
group.bench_function(format!("{entity_count}_entities"), |bencher| {
5353
let world = setup::<Table>(entity_count);
5454

5555
bencher.iter(|| {
@@ -72,7 +72,7 @@ pub fn world_get(criterion: &mut Criterion) {
7272
group.measurement_time(core::time::Duration::from_secs(4));
7373

7474
for entity_count in RANGE.map(|i| i * 10_000) {
75-
group.bench_function(format!("{}_entities_table", entity_count), |bencher| {
75+
group.bench_function(format!("{entity_count}_entities_table"), |bencher| {
7676
let world = setup::<Table>(entity_count);
7777

7878
bencher.iter(|| {
@@ -84,7 +84,7 @@ pub fn world_get(criterion: &mut Criterion) {
8484
}
8585
});
8686
});
87-
group.bench_function(format!("{}_entities_sparse", entity_count), |bencher| {
87+
group.bench_function(format!("{entity_count}_entities_sparse"), |bencher| {
8888
let world = setup::<Sparse>(entity_count);
8989

9090
bencher.iter(|| {
@@ -107,7 +107,7 @@ pub fn world_query_get(criterion: &mut Criterion) {
107107
group.measurement_time(core::time::Duration::from_secs(4));
108108

109109
for entity_count in RANGE.map(|i| i * 10_000) {
110-
group.bench_function(format!("{}_entities_table", entity_count), |bencher| {
110+
group.bench_function(format!("{entity_count}_entities_table"), |bencher| {
111111
let mut world = setup::<Table>(entity_count);
112112
let mut query = world.query::<&Table>();
113113

@@ -120,7 +120,7 @@ pub fn world_query_get(criterion: &mut Criterion) {
120120
}
121121
});
122122
});
123-
group.bench_function(format!("{}_entities_table_wide", entity_count), |bencher| {
123+
group.bench_function(format!("{entity_count}_entities_table_wide"), |bencher| {
124124
let mut world = setup_wide::<(
125125
WideTable<0>,
126126
WideTable<1>,
@@ -147,7 +147,7 @@ pub fn world_query_get(criterion: &mut Criterion) {
147147
}
148148
});
149149
});
150-
group.bench_function(format!("{}_entities_sparse", entity_count), |bencher| {
150+
group.bench_function(format!("{entity_count}_entities_sparse"), |bencher| {
151151
let mut world = setup::<Sparse>(entity_count);
152152
let mut query = world.query::<&Sparse>();
153153

@@ -160,37 +160,33 @@ pub fn world_query_get(criterion: &mut Criterion) {
160160
}
161161
});
162162
});
163-
group.bench_function(
164-
format!("{}_entities_sparse_wide", entity_count),
165-
|bencher| {
166-
let mut world = setup_wide::<(
167-
WideSparse<0>,
168-
WideSparse<1>,
169-
WideSparse<2>,
170-
WideSparse<3>,
171-
WideSparse<4>,
172-
WideSparse<5>,
173-
)>(entity_count);
174-
let mut query = world.query::<(
175-
&WideSparse<0>,
176-
&WideSparse<1>,
177-
&WideSparse<2>,
178-
&WideSparse<3>,
179-
&WideSparse<4>,
180-
&WideSparse<5>,
181-
)>();
182-
183-
bencher.iter(|| {
184-
for i in 0..entity_count {
185-
// SAFETY: Range is exclusive.
186-
let entity = Entity::from_raw(EntityRow::new(unsafe {
187-
NonMaxU32::new_unchecked(i)
188-
}));
189-
assert!(query.get(&world, entity).is_ok());
190-
}
191-
});
192-
},
193-
);
163+
group.bench_function(format!("{entity_count}_entities_sparse_wide"), |bencher| {
164+
let mut world = setup_wide::<(
165+
WideSparse<0>,
166+
WideSparse<1>,
167+
WideSparse<2>,
168+
WideSparse<3>,
169+
WideSparse<4>,
170+
WideSparse<5>,
171+
)>(entity_count);
172+
let mut query = world.query::<(
173+
&WideSparse<0>,
174+
&WideSparse<1>,
175+
&WideSparse<2>,
176+
&WideSparse<3>,
177+
&WideSparse<4>,
178+
&WideSparse<5>,
179+
)>();
180+
181+
bencher.iter(|| {
182+
for i in 0..entity_count {
183+
// SAFETY: Range is exclusive.
184+
let entity =
185+
Entity::from_raw(EntityRow::new(unsafe { NonMaxU32::new_unchecked(i) }));
186+
assert!(query.get(&world, entity).is_ok());
187+
}
188+
});
189+
});
194190
}
195191

196192
group.finish();
@@ -202,7 +198,7 @@ pub fn world_query_iter(criterion: &mut Criterion) {
202198
group.measurement_time(core::time::Duration::from_secs(4));
203199

204200
for entity_count in RANGE.map(|i| i * 10_000) {
205-
group.bench_function(format!("{}_entities_table", entity_count), |bencher| {
201+
group.bench_function(format!("{entity_count}_entities_table"), |bencher| {
206202
let mut world = setup::<Table>(entity_count);
207203
let mut query = world.query::<&Table>();
208204

@@ -216,7 +212,7 @@ pub fn world_query_iter(criterion: &mut Criterion) {
216212
assert_eq!(black_box(count), entity_count);
217213
});
218214
});
219-
group.bench_function(format!("{}_entities_sparse", entity_count), |bencher| {
215+
group.bench_function(format!("{entity_count}_entities_sparse"), |bencher| {
220216
let mut world = setup::<Sparse>(entity_count);
221217
let mut query = world.query::<&Sparse>();
222218

@@ -241,7 +237,7 @@ pub fn world_query_for_each(criterion: &mut Criterion) {
241237
group.measurement_time(core::time::Duration::from_secs(4));
242238

243239
for entity_count in RANGE.map(|i| i * 10_000) {
244-
group.bench_function(format!("{}_entities_table", entity_count), |bencher| {
240+
group.bench_function(format!("{entity_count}_entities_table"), |bencher| {
245241
let mut world = setup::<Table>(entity_count);
246242
let mut query = world.query::<&Table>();
247243

@@ -255,7 +251,7 @@ pub fn world_query_for_each(criterion: &mut Criterion) {
255251
assert_eq!(black_box(count), entity_count);
256252
});
257253
});
258-
group.bench_function(format!("{}_entities_sparse", entity_count), |bencher| {
254+
group.bench_function(format!("{entity_count}_entities_sparse"), |bencher| {
259255
let mut world = setup::<Sparse>(entity_count);
260256
let mut query = world.query::<&Sparse>();
261257

@@ -280,7 +276,7 @@ pub fn query_get(criterion: &mut Criterion) {
280276
group.measurement_time(core::time::Duration::from_secs(4));
281277

282278
for entity_count in RANGE.map(|i| i * 10_000) {
283-
group.bench_function(format!("{}_entities_table", entity_count), |bencher| {
279+
group.bench_function(format!("{entity_count}_entities_table"), |bencher| {
284280
let mut world = World::default();
285281
let mut entities: Vec<_> = world
286282
.spawn_batch((0..entity_count).map(|_| Table::default()))
@@ -299,7 +295,7 @@ pub fn query_get(criterion: &mut Criterion) {
299295
assert_eq!(black_box(count), entity_count);
300296
});
301297
});
302-
group.bench_function(format!("{}_entities_sparse", entity_count), |bencher| {
298+
group.bench_function(format!("{entity_count}_entities_sparse"), |bencher| {
303299
let mut world = World::default();
304300
let mut entities: Vec<_> = world
305301
.spawn_batch((0..entity_count).map(|_| Sparse::default()))
@@ -329,7 +325,7 @@ pub fn query_get_many<const N: usize>(criterion: &mut Criterion) {
329325
group.measurement_time(core::time::Duration::from_secs(2 * N as u64));
330326

331327
for entity_count in RANGE.map(|i| i * 10_000) {
332-
group.bench_function(format!("{}_calls_table", entity_count), |bencher| {
328+
group.bench_function(format!("{entity_count}_calls_table"), |bencher| {
333329
let mut world = World::default();
334330
let mut entity_groups: Vec<_> = (0..entity_count)
335331
.map(|_| [(); N].map(|_| world.spawn(Table::default()).id()))
@@ -352,7 +348,7 @@ pub fn query_get_many<const N: usize>(criterion: &mut Criterion) {
352348
assert_eq!(black_box(count), entity_count);
353349
});
354350
});
355-
group.bench_function(format!("{}_calls_sparse", entity_count), |bencher| {
351+
group.bench_function(format!("{entity_count}_calls_sparse"), |bencher| {
356352
let mut world = World::default();
357353
let mut entity_groups: Vec<_> = (0..entity_count)
358354
.map(|_| [(); N].map(|_| world.spawn(Sparse::default()).id()))

benches/benches/bevy_reflect/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn concrete_map_apply(criterion: &mut Criterion) {
142142

143143
fn u64_to_n_byte_key(k: u64, n: usize) -> String {
144144
let mut key = String::with_capacity(n);
145-
write!(&mut key, "{}", k).unwrap();
145+
write!(&mut key, "{k}").unwrap();
146146

147147
// Pad key to n bytes.
148148
key.extend(iter::repeat_n('\0', n - key.len()));

0 commit comments

Comments
 (0)