Update Rust nightly, stable.

This commit is contained in:
Dario Nieuwenhuis 2025-06-29 22:37:11 +02:00
parent b964bee302
commit 72248a601a
15 changed files with 84 additions and 112 deletions

View File

@ -92,35 +92,3 @@ pub fn set_target_cfgs(cfgs: &mut CfgSet) {
cfgs.set("has_fpu", target.ends_with("-eabihf"));
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct CompilerDate {
year: u16,
month: u8,
day: u8,
}
impl CompilerDate {
fn parse(date: &str) -> Option<Self> {
let mut parts = date.split('-');
let year = parts.next()?.parse().ok()?;
let month = parts.next()?.parse().ok()?;
let day = parts.next()?.parse().ok()?;
Some(Self { year, month, day })
}
}
impl PartialEq<&str> for CompilerDate {
fn eq(&self, other: &&str) -> bool {
let Some(other) = Self::parse(other) else {
return false;
};
self.eq(&other)
}
}
impl PartialOrd<&str> for CompilerDate {
fn partial_cmp(&self, other: &&str) -> Option<std::cmp::Ordering> {
Self::parse(other).map(|other| self.cmp(&other))
}
}

View File

@ -68,6 +68,22 @@ note: required by a bound in `task_pool_align`
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `task_pool_align`
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: task futures must resolve to `()` or `!`
--> tests/ui/bad_return_impl_future.rs:5:4
|
4 | #[embassy_executor::task]
| ------------------------- required by a bound introduced by this call
5 | fn task() -> impl Future<Output = u32> {
| ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Future<Output = u32> {__task_task}`
|
= note: use `async fn` or change the return type to `impl Future<Output = ()>`
note: required by a bound in `__task_pool_get`
--> tests/ui/bad_return_impl_future.rs:4:1
|
4 | #[embassy_executor::task]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__task_pool_get`
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: task futures must resolve to `()` or `!`
--> tests/ui/bad_return_impl_future.rs:5:4
|
@ -102,19 +118,3 @@ note: required by a bound in `task_pool_new`
| F: TaskFn<Args, Fut = Fut>,
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `task_pool_new`
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: task futures must resolve to `()` or `!`
--> tests/ui/bad_return_impl_future.rs:5:4
|
4 | #[embassy_executor::task]
| ------------------------- required by a bound introduced by this call
5 | fn task() -> impl Future<Output = u32> {
| ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Future<Output = u32> {__task_task}`
|
= note: use `async fn` or change the return type to `impl Future<Output = ()>`
note: required by a bound in `__task_pool_get`
--> tests/ui/bad_return_impl_future.rs:4:1
|
4 | #[embassy_executor::task]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__task_pool_get`
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -68,6 +68,39 @@ note: required by a bound in `task_pool_align`
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `task_pool_align`
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: task futures must resolve to `()` or `!`
--> tests/ui/return_impl_send.rs:4:4
|
3 | #[embassy_executor::task]
| ------------------------- required by a bound introduced by this call
4 | fn task() -> impl Send {}
| ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Send {__task_task}`
|
= note: use `async fn` or change the return type to `impl Future<Output = ()>`
note: required by a bound in `__task_pool_get`
--> tests/ui/return_impl_send.rs:3:1
|
3 | #[embassy_executor::task]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__task_pool_get`
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `impl Send` is not a future
--> tests/ui/return_impl_send.rs:3:1
|
3 | #[embassy_executor::task]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ `impl Send` is not a future
|
= help: the trait `Future` is not implemented for `impl Send`
note: required by a bound in `TaskPool::<F, N>::_spawn_async_fn`
--> src/raw/mod.rs
|
| impl<F: Future + 'static, const N: usize> TaskPool<F, N> {
| ^^^^^^ required by this bound in `TaskPool::<F, N>::_spawn_async_fn`
...
| pub unsafe fn _spawn_async_fn<FutFn>(&'static self, future: FutFn) -> SpawnToken<impl Sized>
| --------------- required by a bound in this associated function
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: task futures must resolve to `()` or `!`
--> tests/ui/return_impl_send.rs:4:4
|
@ -102,36 +135,3 @@ note: required by a bound in `task_pool_new`
| F: TaskFn<Args, Fut = Fut>,
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `task_pool_new`
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: task futures must resolve to `()` or `!`
--> tests/ui/return_impl_send.rs:4:4
|
3 | #[embassy_executor::task]
| ------------------------- required by a bound introduced by this call
4 | fn task() -> impl Send {}
| ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Send {__task_task}`
|
= note: use `async fn` or change the return type to `impl Future<Output = ()>`
note: required by a bound in `__task_pool_get`
--> tests/ui/return_impl_send.rs:3:1
|
3 | #[embassy_executor::task]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__task_pool_get`
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `impl Send` is not a future
--> tests/ui/return_impl_send.rs:3:1
|
3 | #[embassy_executor::task]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ `impl Send` is not a future
|
= help: the trait `Future` is not implemented for `impl Send`
note: required by a bound in `TaskPool::<F, N>::_spawn_async_fn`
--> src/raw/mod.rs
|
| impl<F: Future + 'static, const N: usize> TaskPool<F, N> {
| ^^^^^^ required by this bound in `TaskPool::<F, N>::_spawn_async_fn`
...
| pub unsafe fn _spawn_async_fn<FutFn>(&'static self, future: FutFn) -> SpawnToken<impl Sized>
| --------------- required by a bound in this associated function
= note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -245,7 +245,7 @@ impl<'d, T: Instance> Uarte<'d, T> {
}
/// Return the endtx event for use with PPI
pub fn event_endtx(&self) -> Event {
pub fn event_endtx(&self) -> Event<'_> {
let r = T::regs();
Event::from_reg(r.events_endtx())
}

View File

@ -482,7 +482,11 @@ mod ram_helpers {
/// # Safety
///
/// `boot2` must contain a valid 2nd stage boot loader which can be called to re-initialize XIP mode
unsafe fn flash_function_pointers_with_boot2(erase: bool, write: bool, boot2: &[u32; 64]) -> FlashFunctionPointers {
unsafe fn flash_function_pointers_with_boot2(
erase: bool,
write: bool,
boot2: &[u32; 64],
) -> FlashFunctionPointers<'_> {
let boot2_fn_ptr = (boot2 as *const u32 as *const u8).offset(1);
let boot2_fn: unsafe extern "C" fn() -> () = core::mem::transmute(boot2_fn_ptr);
FlashFunctionPointers {

View File

@ -39,7 +39,7 @@ pub struct RelocatedProgram<'a, const PROGRAM_SIZE: usize> {
}
impl<'a, const PROGRAM_SIZE: usize> RelocatedProgram<'a, PROGRAM_SIZE> {
pub fn new_with_origin(program: &Program<PROGRAM_SIZE>, origin: u8) -> RelocatedProgram<PROGRAM_SIZE> {
pub fn new_with_origin(program: &Program<PROGRAM_SIZE>, origin: u8) -> RelocatedProgram<'_, PROGRAM_SIZE> {
RelocatedProgram { program, origin }
}

View File

@ -115,22 +115,22 @@ impl R {
impl W {
#[doc = "Byte 0 - Bits 0:28 - EFID1"]
#[inline(always)]
pub fn efid1(&mut self) -> EFID1_W {
pub fn efid1(&mut self) -> EFID1_W<'_> {
EFID1_W { w: self }
}
#[doc = "Byte 0 - Bits 29:31 - EFEC"]
#[inline(always)]
pub fn efec(&mut self) -> EFEC_W {
pub fn efec(&mut self) -> EFEC_W<'_> {
EFEC_W { w: self }
}
#[doc = "Byte 1 - Bits 0:28 - EFID2"]
#[inline(always)]
pub fn efid2(&mut self) -> EFID2_W {
pub fn efid2(&mut self) -> EFID2_W<'_> {
EFID2_W { w: self }
}
#[doc = "Byte 1 - Bits 30:31 - EFT"]
#[inline(always)]
pub fn eft(&mut self) -> EFT_W {
pub fn eft(&mut self) -> EFT_W<'_> {
EFT_W { w: self }
}
}

View File

@ -115,22 +115,22 @@ impl R {
impl W {
#[doc = "Bits 0:10 - SFID2"]
#[inline(always)]
pub fn sfid2(&mut self) -> SFID2_W {
pub fn sfid2(&mut self) -> SFID2_W<'_> {
SFID2_W { w: self }
}
#[doc = "Bits 16:26 - SFID1"]
#[inline(always)]
pub fn sfid1(&mut self) -> SFID1_W {
pub fn sfid1(&mut self) -> SFID1_W<'_> {
SFID1_W { w: self }
}
#[doc = "Bits 27:29 - SFEC"]
#[inline(always)]
pub fn sfec(&mut self) -> SFEC_W {
pub fn sfec(&mut self) -> SFEC_W<'_> {
SFEC_W { w: self }
}
#[doc = "Bits 30:31 - SFT"]
#[inline(always)]
pub fn sft(&mut self) -> SFT_W {
pub fn sft(&mut self) -> SFT_W<'_> {
SFT_W { w: self }
}
}

View File

@ -376,47 +376,47 @@ impl R {
impl W {
#[doc = "Byte 0 - Bits 0:28 - ID"]
#[inline(always)]
pub fn id(&mut self) -> ID_W {
pub fn id(&mut self) -> ID_W<'_> {
ID_W { w: self }
}
#[doc = "Byte 0 - Bit 29 - RTR"]
#[inline(always)]
pub fn rtr(&mut self) -> RTR_W {
pub fn rtr(&mut self) -> RTR_W<'_> {
RTR_W { w: self }
}
#[doc = "Byte 0 - Bit 30 - XTD"]
#[inline(always)]
pub fn xtd(&mut self) -> XTD_W {
pub fn xtd(&mut self) -> XTD_W<'_> {
XTD_W { w: self }
}
#[doc = "Byte 0 - Bit 31 - ESI"]
#[inline(always)]
pub fn esi(&mut self) -> ESI_W {
pub fn esi(&mut self) -> ESI_W<'_> {
ESI_W { w: self }
}
#[doc = "Byte 1 - Bit 16:19 - DLC"]
#[inline(always)]
pub fn dlc(&mut self) -> DLC_W {
pub fn dlc(&mut self) -> DLC_W<'_> {
DLC_W { w: self }
}
#[doc = "Byte 1 - Bit 20 - BRS"]
#[inline(always)]
pub fn brs(&mut self) -> BRS_W {
pub fn brs(&mut self) -> BRS_W<'_> {
BRS_W { w: self }
}
#[doc = "Byte 1 - Bit 21 - FDF"]
#[inline(always)]
pub fn fdf(&mut self) -> FDF_W {
pub fn fdf(&mut self) -> FDF_W<'_> {
FDF_W { w: self }
}
#[doc = "Byte 1 - Bit 23 - EFC"]
#[inline(always)]
pub fn efc(&mut self) -> EFC_W {
pub fn efc(&mut self) -> EFC_W<'_> {
EFC_W { w: self }
}
#[doc = "Byte 1 - Bit 24:31 - MM"]
#[inline(always)]
pub fn mm(&mut self) -> MM_W {
pub fn mm(&mut self) -> MM_W<'_> {
MM_W { w: self }
}
#[doc = "Convenience function for setting the data length and frame format"]

View File

@ -5,7 +5,7 @@ macro_rules! floating_fixed_convert {
($f_to_q:ident, $q_to_f:ident, $unsigned_bin_typ:ty, $signed_bin_typ:ty, $float_ty:ty, $offset:literal, $min_positive:literal) => {
/// convert float point to fixed point format
pub fn $f_to_q(value: $float_ty) -> Result<$unsigned_bin_typ, NumberOutOfRange> {
const MIN_POSITIVE: $float_ty = unsafe { core::mem::transmute($min_positive) };
const MIN_POSITIVE: $float_ty = <$float_ty>::from_bits($min_positive);
if value < -1.0 {
return Err(NumberOutOfRange::BelowLowerBound)

View File

@ -32,7 +32,7 @@ impl AcquisitionBankPins {
/// Returns an iterator over the pins in this acquisition bank.
///
/// This method allows for easy traversal of all configured pins in the bank.
pub fn iter(&self) -> AcquisitionBankPinsIterator {
pub fn iter(&self) -> AcquisitionBankPinsIterator<'_> {
AcquisitionBankPinsIterator(AcquisitionBankIterator::new(self))
}
}
@ -90,7 +90,7 @@ impl<'a> Iterator for AcquisitionBankPinsIterator<'a> {
impl AcquisitionBankPins {
/// Returns an iterator over the available pins in the bank
pub fn pins_iterator(&self) -> AcquisitionBankPinsIterator {
pub fn pins_iterator(&self) -> AcquisitionBankPinsIterator<'_> {
AcquisitionBankPinsIterator(AcquisitionBankIterator::new(self))
}
}
@ -107,7 +107,7 @@ pub struct AcquisitionBank {
impl AcquisitionBank {
/// Returns an iterator over the available pins in the bank.
pub fn pins_iterator(&self) -> AcquisitionBankPinsIterator {
pub fn pins_iterator(&self) -> AcquisitionBankPinsIterator<'_> {
self.pins.pins_iterator()
}

View File

@ -88,7 +88,7 @@ impl<M: RawMutex, T: Clone, const CAP: usize, const SUBS: usize, const PUBS: usi
/// Create a new subscriber. It will only receive messages that are published after its creation.
///
/// If there are no subscriber slots left, an error will be returned.
pub fn subscriber(&self) -> Result<Subscriber<M, T, CAP, SUBS, PUBS>, Error> {
pub fn subscriber(&self) -> Result<Subscriber<'_, M, T, CAP, SUBS, PUBS>, Error> {
self.inner.lock(|inner| {
let mut s = inner.borrow_mut();
@ -120,7 +120,7 @@ impl<M: RawMutex, T: Clone, const CAP: usize, const SUBS: usize, const PUBS: usi
/// Create a new publisher
///
/// If there are no publisher slots left, an error will be returned.
pub fn publisher(&self) -> Result<Publisher<M, T, CAP, SUBS, PUBS>, Error> {
pub fn publisher(&self) -> Result<Publisher<'_, M, T, CAP, SUBS, PUBS>, Error> {
self.inner.lock(|inner| {
let mut s = inner.borrow_mut();
@ -151,13 +151,13 @@ impl<M: RawMutex, T: Clone, const CAP: usize, const SUBS: usize, const PUBS: usi
/// Create a new publisher that can only send immediate messages.
/// This kind of publisher does not take up a publisher slot.
pub fn immediate_publisher(&self) -> ImmediatePublisher<M, T, CAP, SUBS, PUBS> {
pub fn immediate_publisher(&self) -> ImmediatePublisher<'_, M, T, CAP, SUBS, PUBS> {
ImmediatePublisher(ImmediatePub::new(self))
}
/// Create a new publisher that can only send immediate messages.
/// This kind of publisher does not take up a publisher slot.
pub fn dyn_immediate_publisher(&self) -> DynImmediatePublisher<T> {
pub fn dyn_immediate_publisher(&self) -> DynImmediatePublisher<'_, T> {
DynImmediatePublisher(ImmediatePub::new(self))
}

View File

@ -84,7 +84,7 @@ impl<'d> Control<'d> {
}
impl<'d> Handler for Control<'d> {
fn control_in(&mut self, req: Request, _data: &mut [u8]) -> Option<InResponse> {
fn control_in(&mut self, req: Request, _data: &mut [u8]) -> Option<InResponse<'_>> {
let landing_value = if self.landing_url.is_some() { 1 } else { 0 };
if req.request_type == RequestType::Vendor
&& req.recipient == Recipient::Device

View File

@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2025-03-12"
channel = "nightly-2025-06-29"
components = [ "rust-src", "rustfmt", "llvm-tools", "miri" ]
targets = [
"thumbv7em-none-eabi",

View File

@ -1,5 +1,5 @@
[toolchain]
channel = "1.85"
channel = "1.88"
components = [ "rust-src", "rustfmt", "llvm-tools" ]
targets = [
"thumbv7em-none-eabi",