Skip to content

Commit d7bfe24

Browse files
authored
Merge pull request #571 from Ioan-Cristian/rust-version-bump
Bump Rust version to 1.87
2 parents ec46e6c + de87aa2 commit d7bfe24

File tree

23 files changed

+61
-40
lines changed

23 files changed

+61
-40
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ version = "0.1.0"
1313
[workspace.package]
1414
# This must be kept in sync with rust-toolchain.toml; please see that file for
1515
# more information.
16-
rust-version = "1.77"
16+
rust-version = "1.87"
1717

1818
[features]
1919
rust_embedded = [

apis/interface/buttons/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use libtock_platform::{
2525
/// }
2626
/// });
2727
/// ```
28-
2928
pub struct Buttons<S: Syscalls>(S);
3029

3130
#[derive(Copy, Clone, Debug, Eq, PartialEq)]

apis/interface/leds/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use libtock_platform::{ErrorCode, Syscalls};
1111
/// // Turn on led 0
1212
/// let _ = Leds::on(0);
1313
/// ```
14-
1514
pub struct Leds<S: Syscalls>(S);
1615

1716
impl<S: Syscalls> Leds<S> {

apis/kernel/low_level_debug/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use libtock_platform::Syscalls;
1515
/// // Prints 0x45 and the app which called it.
1616
/// LowLevelDebug::print_1(0x45);
1717
/// ```
18-
1918
pub struct LowLevelDebug<S: Syscalls>(S);
2019

2120
impl<S: Syscalls> LowLevelDebug<S> {

apis/net/ieee802154/src/rx.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const EMPTY_FRAME: Frame = Frame {
2323

2424
/// The ring buffer that is shared with kernel using allow-rw syscall, with kernel acting
2525
/// as a producer of frames and we acting a consumer.
26-
26+
///
2727
/// The `N` parameter specifies the capacity of the buffer in number of frames.
2828
/// Unfortunately, due to a design flaw of the ring buffer, it can never be fully utilised,
2929
/// as it's impossible to distinguish an empty buffer from a full one. The kernel code
@@ -52,6 +52,12 @@ pub struct RxRingBuffer<const N: usize> {
5252
frames: [Frame; N],
5353
}
5454

55+
impl<const N: usize> Default for RxRingBuffer<N> {
56+
fn default() -> Self {
57+
Self::new()
58+
}
59+
}
60+
5561
impl<const N: usize> RxRingBuffer<N> {
5662
/// Creates a new [RxRingBuffer] that can be used to receive frames into.
5763
pub const fn new() -> Self {
@@ -116,9 +122,7 @@ impl<'buf, const N: usize, S: Syscalls, C: Config> RxSingleBufferOperator<'buf,
116122
}
117123
}
118124
}
119-
impl<'buf, const N: usize, S: Syscalls, C: Config> RxOperator
120-
for RxSingleBufferOperator<'buf, N, S, C>
121-
{
125+
impl<const N: usize, S: Syscalls, C: Config> RxOperator for RxSingleBufferOperator<'_, N, S, C> {
122126
fn receive_frame(&mut self) -> Result<&mut Frame, ErrorCode> {
123127
if self.buf.has_frame() {
124128
Ok(self.buf.next_frame())

apis/peripherals/alarm/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use libtock_platform::{DefaultConfig, ErrorCode, Syscalls};
1414
/// // Wait for timeout
1515
/// Alarm::sleep(Alarm::Milliseconds(2500));
1616
/// ```
17-
1817
pub struct Alarm<S: Syscalls, C: platform::subscribe::Config = DefaultConfig>(S, C);
1918

2019
#[derive(Copy, Clone, Debug, PartialEq, Eq)]

apis/peripherals/gpio/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use libtock_platform::{
1616
/// let pin = gpio::Gpio::get_pin(0).unwrap().make_output().unwrap();
1717
/// let _ = pin.set();
1818
/// ```
19-
2019
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
2120
pub enum GpioState {
2221
Low = 0,
@@ -145,7 +144,7 @@ pub struct OutputPin<'a, S: Syscalls> {
145144
pin: &'a Pin<S>,
146145
}
147146

148-
impl<'a, S: Syscalls> OutputPin<'a, S> {
147+
impl<S: Syscalls> OutputPin<'_, S> {
149148
pub fn toggle(&mut self) -> Result<(), ErrorCode> {
150149
Gpio::<S>::toggle(self.pin.pin_number)
151150
}
@@ -162,7 +161,7 @@ pub struct InputPin<'a, S: Syscalls, P: Pull> {
162161
_pull: PhantomData<P>,
163162
}
164163

165-
impl<'a, S: Syscalls, P: Pull> InputPin<'a, S, P> {
164+
impl<S: Syscalls, P: Pull> InputPin<'_, S, P> {
166165
pub fn read(&self) -> Result<GpioState, ErrorCode> {
167166
Gpio::<S>::read(self.pin.pin_number)
168167
}
@@ -232,12 +231,12 @@ impl<S: Syscalls> Gpio<S> {
232231
}
233232

234233
#[cfg(feature = "rust_embedded")]
235-
impl<'a, S: Syscalls> embedded_hal::digital::ErrorType for OutputPin<'a, S> {
234+
impl<S: Syscalls> embedded_hal::digital::ErrorType for OutputPin<'_, S> {
236235
type Error = ErrorCode;
237236
}
238237

239238
#[cfg(feature = "rust_embedded")]
240-
impl<'a, S: Syscalls> embedded_hal::digital::OutputPin for OutputPin<'a, S> {
239+
impl<S: Syscalls> embedded_hal::digital::OutputPin for OutputPin<'_, S> {
241240
fn set_low(&mut self) -> Result<(), Self::Error> {
242241
self.clear()
243242
}

demos/st7789-slint/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ unsafe fn setup_heap() {
5151

5252
const HEAP_SIZE: usize = 1024 * 6;
5353
static mut HEAP_MEM: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
54-
unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) }
54+
unsafe { HEAP.init(&raw mut HEAP_MEM as usize, HEAP_SIZE) }
5555
}
5656

5757
// Display

nightly/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# This is the nightly Rust toolchain used by `make test`.
22
[toolchain]
3-
channel = "nightly-2024-11-11"
3+
channel = "nightly-2025-05-19"
44
components = ["miri", "rust-src"]

panic_handlers/debug_panic/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use libtock_platform::{ErrorCode, Syscalls};
66
use libtock_runtime::TockSyscalls;
77

88
/// This handler requires some 0x400 bytes of stack
9-
109
#[panic_handler]
1110
fn panic_handler(info: &core::panic::PanicInfo) -> ! {
1211
// Signal a panic using the LowLevelDebug capsule (if available).

0 commit comments

Comments
 (0)