Skip to content

Commit f3a29da

Browse files
committed
Update to latest nightly
1 parent 25e3081 commit f3a29da

File tree

21 files changed

+61
-55
lines changed

21 files changed

+61
-55
lines changed

core/src/cpu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub mod bus;
22
pub mod psr;
33
pub mod schedule;
4-
pub(crate) use schedule::{Schedule, ScheduleConst};
4+
pub(crate) use schedule::Schedule;
55
mod irqs;
66
pub(crate) use irqs::Irqs;
77
#[cfg(any(feature = "debugger-hooks", doc))]

core/src/cpu/arm7/schedule.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,11 @@ impl Schedule {
115115
}
116116
}
117117

118-
impl const cpu::ScheduleConst for Schedule {
118+
impl cpu::Schedule for Schedule {
119119
type Timestamp = Timestamp;
120120
type Event = Event;
121121
type EventSlotIndex = EventSlotIndex;
122122

123-
#[inline]
124-
fn timer_event_slot(i: timers::Index) -> EventSlotIndex {
125-
EventSlotIndex::new(event_slots::TIMERS_START.get() + i.get())
126-
}
127-
}
128-
129-
impl cpu::Schedule for Schedule {
130123
#[inline]
131124
fn cur_time(&self) -> Timestamp {
132125
self.cur_time
@@ -152,12 +145,15 @@ impl cpu::Schedule for Schedule {
152145
self.schedule.set_event(slot_index, event);
153146
}
154147

148+
#[inline]
149+
fn timer_event_slot(i: timers::Index) -> EventSlotIndex {
150+
EventSlotIndex::new(event_slots::TIMERS_START.get() + i.get())
151+
}
152+
155153
#[inline]
156154
fn set_timer_event(&mut self, i: timers::Index) {
157-
self.schedule.set_event(
158-
<Self as cpu::ScheduleConst>::timer_event_slot(i),
159-
Event::Timer(i),
160-
);
155+
self.schedule
156+
.set_event(Self::timer_event_slot(i), Event::Timer(i));
161157
}
162158

163159
#[inline]

core/src/cpu/arm9/bus/ptrs.rs

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ cfg_if::cfg_if! {
5454
}
5555
}
5656

57+
#[allow(clippy::struct_field_names)]
5758
#[repr(C)]
5859
pub struct Ptrs {
5960
ptrs: [*mut u8; Self::ENTRIES],

core/src/cpu/arm9/cp15/ptrs.rs

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ mod mask {
8080
pub const ALL: Mask = R_ALL | W_ALL;
8181
}
8282

83+
#[allow(clippy::struct_field_names)]
8384
#[repr(C)]
8485
pub struct Ptrs {
8586
r_code_ptrs: [*const u8; Self::ENTRIES],

core/src/cpu/arm9/schedule.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,11 @@ impl Schedule {
9090
}
9191
}
9292

93-
impl const cpu::ScheduleConst for Schedule {
93+
impl cpu::Schedule for Schedule {
9494
type Timestamp = Timestamp;
9595
type Event = Event;
9696
type EventSlotIndex = EventSlotIndex;
9797

98-
#[inline]
99-
fn timer_event_slot(i: timers::Index) -> EventSlotIndex {
100-
EventSlotIndex::new(event_slots::TIMERS_START.get() + i.get())
101-
}
102-
}
103-
104-
impl cpu::Schedule for Schedule {
10598
#[inline]
10699
fn cur_time(&self) -> Timestamp {
107100
self.cur_time
@@ -127,12 +120,15 @@ impl cpu::Schedule for Schedule {
127120
self.schedule.set_event(slot_index, event);
128121
}
129122

123+
#[inline]
124+
fn timer_event_slot(i: timers::Index) -> EventSlotIndex {
125+
EventSlotIndex::new(event_slots::TIMERS_START.get() + i.get())
126+
}
127+
130128
#[inline]
131129
fn set_timer_event(&mut self, i: timers::Index) {
132-
self.schedule.set_event(
133-
<Self as cpu::ScheduleConst>::timer_event_slot(i),
134-
Event::Timer(i),
135-
);
130+
self.schedule
131+
.set_event(Self::timer_event_slot(i), Event::Timer(i));
136132
}
137133

138134
#[inline]

core/src/cpu/debug.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,13 @@ impl MemWatchpointRootTable {
7777

7878
pub(super) fn remove(&mut self, addr: u32, size: u8, rw: MemWatchpointRwMask) {
7979
let root_i = (addr >> 21) as usize;
80-
let Some(sub_table) = &mut self.0[root_i] else { return };
80+
let Some(sub_table) = &mut self.0[root_i] else {
81+
return;
82+
};
8183
let sub_i = (addr >> 10 & 0x7FF) as usize;
82-
let Some(leaf_table) = &mut sub_table.0[sub_i] else { return };
84+
let Some(leaf_table) = &mut sub_table.0[sub_i] else {
85+
return;
86+
};
8387
let mut mask = rw.bits() as usize;
8488
for i in 0..size.trailing_zeros() {
8589
mask |= mask << (2 << i);

core/src/cpu/schedule.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use crate::{
44
utils::{Loadable, LoadableInPlace, Storable},
55
};
66

7-
#[const_trait]
8-
pub trait ScheduleConst {
7+
pub trait Schedule {
98
type Timestamp: Copy
109
+ From<emu::Timestamp>
1110
+ Into<emu::Timestamp>
@@ -21,10 +20,6 @@ pub trait ScheduleConst {
2120
type Event: Copy + Loadable + LoadableInPlace + Storable;
2221
type EventSlotIndex: Copy + Loadable + LoadableInPlace + Storable;
2322

24-
fn timer_event_slot(i: timers::Index) -> Self::EventSlotIndex;
25-
}
26-
27-
pub trait Schedule: ~const ScheduleConst {
2823
fn cur_time(&self) -> Self::Timestamp;
2924
fn set_cur_time(&mut self, value: Self::Timestamp);
3025
#[inline]
@@ -40,6 +35,8 @@ pub trait Schedule: ~const ScheduleConst {
4035
}
4136

4237
fn set_event(&mut self, slot_index: Self::EventSlotIndex, event: Self::Event);
38+
39+
fn timer_event_slot(i: timers::Index) -> Self::EventSlotIndex;
4340
fn set_timer_event(&mut self, i: timers::Index);
4441

4542
fn schedule_event(&mut self, slot_index: Self::EventSlotIndex, time: Self::Timestamp);

core/src/emu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl Builder {
283283

284284
ds_rom
285285
.setup(self.direct_boot)
286-
.map_err(|_| BuildError::RomNeedsDecryptionButNoBiosProvided)?;
286+
.map_err(|()| BuildError::RomNeedsDecryptionButNoBiosProvided)?;
287287

288288
let (global_engine_data, arm7_engine_data, arm9_engine_data) = engine.into_data();
289289
let mut arm7 = Arm7::new(

core/src/gpu/engine_3d.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ use crate::{
1717
};
1818
use core::{
1919
mem::{replace, transmute, MaybeUninit},
20-
simd::{i32x4, u32x2, u64x2, SimdInt, SimdOrd, SimdUint},
20+
simd::{
21+
cmp::SimdOrd,
22+
i32x4,
23+
num::{SimdInt, SimdUint},
24+
u32x2, u64x2,
25+
},
2126
};
2227
use matrix::{Matrix, MatrixBuffer};
2328
use vertex::Vertex;

core/src/gpu/engine_3d/matrix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::utils::Savestate;
22
use core::ops::Mul;
3-
use core::simd::{i32x4, i64x4, Simd, SimdCast, SimdElement, SimdInt};
3+
use core::simd::{i32x4, i64x4, num::SimdInt, Simd, SimdCast, SimdElement};
44

55
#[derive(Clone, Copy, Debug)]
66
#[repr(align(16))]

core/src/gpu/engine_3d/vertex.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use crate::utils::Savestate;
22
use core::simd::{
3-
i16x2, i32x4, i64x2, i64x4, mask64x4, simd_swizzle, u16x2, u16x4, u8x4, SimdInt, SimdPartialEq,
4-
SimdUint,
3+
cmp::SimdPartialEq,
4+
i16x2, i32x4, i64x2, i64x4, mask64x4,
5+
num::{SimdInt, SimdUint},
6+
simd_swizzle, u16x2, u16x4, u8x4,
57
};
68

79
pub type TexCoords = i16x2;

core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
maybe_uninit_slice,
1010
portable_simd,
1111
const_mut_refs,
12-
const_trait_impl,
1312
const_for,
1413
new_uninit
1514
)]

frontend/desktop/src/audio/input/cpal.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ struct InputData {
9090
}
9191

9292
impl InputData {
93-
fn fill<T: Sample>(&mut self, data: &[T]) where f64: cpal::FromSample<T> {
93+
fn fill<T: Sample>(&mut self, data: &[T])
94+
where
95+
f64: cpal::FromSample<T>,
96+
{
9497
if let Some(interp) = self.interp_rx.try_iter().last() {
9598
self.interp = interp;
9699
}

frontend/desktop/src/input.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ mod map;
22
pub use map::Map;
33
mod state;
44
pub use state::{Changes, State};
5-
pub mod trigger;
65
pub mod key_codes;
6+
pub mod trigger;
77
pub use key_codes::{KeyCode, ScanCode};
88

99
use winit::keyboard::PhysicalKey;

frontend/desktop/src/input/trigger.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ impl Trigger {
6262

6363
impl ToString for Trigger {
6464
fn to_string(&self) -> String {
65-
fn write_trigger(
66-
result: &mut String,
67-
trigger: &Trigger,
68-
needs_parens_if_multiple: bool,
69-
) {
65+
fn write_trigger(result: &mut String, trigger: &Trigger, needs_parens_if_multiple: bool) {
7066
match trigger {
7167
&Trigger::KeyCode(key_code) => {
7268
write!(result, "v{}", <&str>::from(key_code)).unwrap();
@@ -273,7 +269,7 @@ impl<'a> TriggerParser<'a> {
273269
kind: ParseErrorKind::ExpectedValue,
274270
});
275271
}
276-
272+
277273
if let Some(op) = op {
278274
return Ok(Trigger::Chain(op, values));
279275
} else {

frontend/desktop/src/ui/savestate_editor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl Editor {
314314
for [a, b] in chunks {
315315
text_heights.push(text_height(a).max(text_height(b)));
316316
}
317-
if let Some(last) = last.get(0) {
317+
if let Some(last) = last.first() {
318318
text_heights.push(text_height(last));
319319
}
320320
}

frontend/desktop/src/ui/window.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ impl GfxState {
4646
backends: wgpu::Backends::all(),
4747
..Default::default()
4848
});
49-
let surface = unsafe { instance.create_surface_from_raw(window) }.expect("Couldn't create surface");
49+
let surface =
50+
unsafe { instance.create_surface_from_raw(window) }.expect("Couldn't create surface");
5051

5152
let adapter = match adapter {
5253
AdapterSelection::Auto(power_preference) => {
@@ -85,7 +86,7 @@ impl GfxState {
8586
format: {
8687
let formats = surface.get_capabilities(&adapter).formats;
8788
let preferred = formats
88-
.get(0)
89+
.first()
8990
.expect("Couldn't get surface preferred format");
9091
#[cfg(target_os = "macos")]
9192
{
@@ -155,7 +156,7 @@ impl GfxState {
155156
.surface
156157
.get_capabilities(&self.adapter)
157158
.formats
158-
.get(0)
159+
.first()
159160
.expect("Couldn't get surface preferred format");
160161
if new_format != self.surface_config.format {
161162
self.surface_config.format = new_format;

render/soft-3d/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod data;
55
pub use data::RenderingData;
66
mod utils;
77

8-
use core::simd::{SimdOrd, SimdUint};
8+
use core::simd::{cmp::SimdOrd, num::SimdUint};
99
use dust_core::gpu::{
1010
engine_3d::{
1111
Color, InterpColor, PolyAddr, PolyVertIndex, PolygonAttrs, TexCoords, TextureParams,

render/soft-3d/src/utils.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
use core::simd::{i32x2, i64x2, u32x4, u64x4, SimdInt, SimdPartialEq, SimdPartialOrd, SimdUint};
1+
use core::simd::{
2+
cmp::{SimdPartialEq, SimdPartialOrd},
3+
i32x2, i64x2,
4+
num::{SimdInt, SimdUint},
5+
u32x4, u64x4,
6+
};
27
use dust_core::gpu::engine_3d::{
38
InterpColor, PolyVertIndex, PolyVertsLen, Polygon, ScreenVertex, TexCoords, VertexAddr,
49
};

render/wgpu-3d/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod utils;
1919
use ahash::AHashMap as HashMap;
2020
use core::{
2121
mem::{self, MaybeUninit},
22-
simd::SimdUint,
22+
simd::num::SimdUint,
2323
// simd::u16x2,
2424
slice,
2525
};

render/wgpu-3d/src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use core::simd::{f64x4, SimdUint};
1+
use core::simd::{f64x4, num::SimdUint};
22
use dust_core::gpu::engine_3d::Color;
33

44
#[inline]

0 commit comments

Comments
 (0)