diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-07-03 23:20:58 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-03 23:20:58 +0000 |
| commit | f53b6649dd42918f7d5228d06821ac5b95e33d38 (patch) | |
| tree | 69f935b94f3521ddc59abeda18ae65ed10013e1a /embassy-executor | |
| parent | b964bee302fc3631d14d73d9a9b406e7352cd550 (diff) | |
| parent | a29267752a382ff52b052233586ef9007fe84fed (diff) | |
Merge pull request #4356 from embassy-rs/update-rust5
Update Rust nightly, stable.
Diffstat (limited to 'embassy-executor')
| -rw-r--r-- | embassy-executor/build_common.rs | 32 | ||||
| -rw-r--r-- | embassy-executor/tests/ui/bad_return_impl_future.stderr | 32 | ||||
| -rw-r--r-- | embassy-executor/tests/ui/return_impl_send.stderr | 64 |
3 files changed, 48 insertions, 80 deletions
diff --git a/embassy-executor/build_common.rs b/embassy-executor/build_common.rs index b15a8369f..4f24e6d37 100644 --- a/embassy-executor/build_common.rs +++ b/embassy-executor/build_common.rs | |||
| @@ -92,35 +92,3 @@ pub fn set_target_cfgs(cfgs: &mut CfgSet) { | |||
| 92 | 92 | ||
| 93 | cfgs.set("has_fpu", target.ends_with("-eabihf")); | 93 | cfgs.set("has_fpu", target.ends_with("-eabihf")); |
| 94 | } | 94 | } |
| 95 | |||
| 96 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] | ||
| 97 | pub struct CompilerDate { | ||
| 98 | year: u16, | ||
| 99 | month: u8, | ||
| 100 | day: u8, | ||
| 101 | } | ||
| 102 | |||
| 103 | impl CompilerDate { | ||
| 104 | fn parse(date: &str) -> Option<Self> { | ||
| 105 | let mut parts = date.split('-'); | ||
| 106 | let year = parts.next()?.parse().ok()?; | ||
| 107 | let month = parts.next()?.parse().ok()?; | ||
| 108 | let day = parts.next()?.parse().ok()?; | ||
| 109 | Some(Self { year, month, day }) | ||
| 110 | } | ||
| 111 | } | ||
| 112 | |||
| 113 | impl PartialEq<&str> for CompilerDate { | ||
| 114 | fn eq(&self, other: &&str) -> bool { | ||
| 115 | let Some(other) = Self::parse(other) else { | ||
| 116 | return false; | ||
| 117 | }; | ||
| 118 | self.eq(&other) | ||
| 119 | } | ||
| 120 | } | ||
| 121 | |||
| 122 | impl PartialOrd<&str> for CompilerDate { | ||
| 123 | fn partial_cmp(&self, other: &&str) -> Option<std::cmp::Ordering> { | ||
| 124 | Self::parse(other).map(|other| self.cmp(&other)) | ||
| 125 | } | ||
| 126 | } | ||
diff --git a/embassy-executor/tests/ui/bad_return_impl_future.stderr b/embassy-executor/tests/ui/bad_return_impl_future.stderr index 2980fd18b..57f147714 100644 --- a/embassy-executor/tests/ui/bad_return_impl_future.stderr +++ b/embassy-executor/tests/ui/bad_return_impl_future.stderr | |||
| @@ -77,6 +77,22 @@ error[E0277]: task futures must resolve to `()` or `!` | |||
| 77 | | ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Future<Output = u32> {__task_task}` | 77 | | ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Future<Output = u32> {__task_task}` |
| 78 | | | 78 | | |
| 79 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` | 79 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` |
| 80 | note: required by a bound in `__task_pool_get` | ||
| 81 | --> tests/ui/bad_return_impl_future.rs:4:1 | ||
| 82 | | | ||
| 83 | 4 | #[embassy_executor::task] | ||
| 84 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__task_pool_get` | ||
| 85 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
| 86 | |||
| 87 | error[E0277]: task futures must resolve to `()` or `!` | ||
| 88 | --> tests/ui/bad_return_impl_future.rs:5:4 | ||
| 89 | | | ||
| 90 | 4 | #[embassy_executor::task] | ||
| 91 | | ------------------------- required by a bound introduced by this call | ||
| 92 | 5 | fn task() -> impl Future<Output = u32> { | ||
| 93 | | ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Future<Output = u32> {__task_task}` | ||
| 94 | | | ||
| 95 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` | ||
| 80 | note: required by a bound in `task_pool_new` | 96 | note: required by a bound in `task_pool_new` |
| 81 | --> src/lib.rs | 97 | --> src/lib.rs |
| 82 | | | 98 | | |
| @@ -102,19 +118,3 @@ note: required by a bound in `task_pool_new` | |||
| 102 | | F: TaskFn<Args, Fut = Fut>, | 118 | | F: TaskFn<Args, Fut = Fut>, |
| 103 | | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `task_pool_new` | 119 | | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `task_pool_new` |
| 104 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) | 120 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 105 | |||
| 106 | error[E0277]: task futures must resolve to `()` or `!` | ||
| 107 | --> tests/ui/bad_return_impl_future.rs:5:4 | ||
| 108 | | | ||
| 109 | 4 | #[embassy_executor::task] | ||
| 110 | | ------------------------- required by a bound introduced by this call | ||
| 111 | 5 | fn task() -> impl Future<Output = u32> { | ||
| 112 | | ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Future<Output = u32> {__task_task}` | ||
| 113 | | | ||
| 114 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` | ||
| 115 | note: required by a bound in `__task_pool_get` | ||
| 116 | --> tests/ui/bad_return_impl_future.rs:4:1 | ||
| 117 | | | ||
| 118 | 4 | #[embassy_executor::task] | ||
| 119 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__task_pool_get` | ||
| 120 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
diff --git a/embassy-executor/tests/ui/return_impl_send.stderr b/embassy-executor/tests/ui/return_impl_send.stderr index 7e3e468b8..cd693af2b 100644 --- a/embassy-executor/tests/ui/return_impl_send.stderr +++ b/embassy-executor/tests/ui/return_impl_send.stderr | |||
| @@ -77,30 +77,28 @@ error[E0277]: task futures must resolve to `()` or `!` | |||
| 77 | | ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Send {__task_task}` | 77 | | ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Send {__task_task}` |
| 78 | | | 78 | | |
| 79 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` | 79 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` |
| 80 | note: required by a bound in `task_pool_new` | 80 | note: required by a bound in `__task_pool_get` |
| 81 | --> src/lib.rs | 81 | --> tests/ui/return_impl_send.rs:3:1 |
| 82 | | | 82 | | |
| 83 | | pub const fn task_pool_new<F, Args, Fut, const POOL_SIZE: usize>(_: F) -> TaskPool<Fut, POOL_SIZE> | 83 | 3 | #[embassy_executor::task] |
| 84 | | ------------- required by a bound in this function | 84 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__task_pool_get` |
| 85 | | where | 85 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 86 | | F: TaskFn<Args, Fut = Fut>, | ||
| 87 | | ^^^^^^^^^ required by this bound in `task_pool_new` | ||
| 88 | 86 | ||
| 89 | error[E0277]: task futures must resolve to `()` or `!` | 87 | error[E0277]: `impl Send` is not a future |
| 90 | --> tests/ui/return_impl_send.rs:3:1 | 88 | --> tests/ui/return_impl_send.rs:3:1 |
| 91 | | | 89 | | |
| 92 | 3 | #[embassy_executor::task] | 90 | 3 | #[embassy_executor::task] |
| 93 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Send {__task_task}` | 91 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ `impl Send` is not a future |
| 94 | | | 92 | | |
| 95 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` | 93 | = help: the trait `Future` is not implemented for `impl Send` |
| 96 | note: required by a bound in `task_pool_new` | 94 | note: required by a bound in `TaskPool::<F, N>::_spawn_async_fn` |
| 97 | --> src/lib.rs | 95 | --> src/raw/mod.rs |
| 98 | | | 96 | | |
| 99 | | pub const fn task_pool_new<F, Args, Fut, const POOL_SIZE: usize>(_: F) -> TaskPool<Fut, POOL_SIZE> | 97 | | impl<F: Future + 'static, const N: usize> TaskPool<F, N> { |
| 100 | | ------------- required by a bound in this function | 98 | | ^^^^^^ required by this bound in `TaskPool::<F, N>::_spawn_async_fn` |
| 101 | | where | 99 | ... |
| 102 | | F: TaskFn<Args, Fut = Fut>, | 100 | | pub unsafe fn _spawn_async_fn<FutFn>(&'static self, future: FutFn) -> SpawnToken<impl Sized> |
| 103 | | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `task_pool_new` | 101 | | --------------- required by a bound in this associated function |
| 104 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) | 102 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 105 | 103 | ||
| 106 | error[E0277]: task futures must resolve to `()` or `!` | 104 | error[E0277]: task futures must resolve to `()` or `!` |
| @@ -112,26 +110,28 @@ error[E0277]: task futures must resolve to `()` or `!` | |||
| 112 | | ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Send {__task_task}` | 110 | | ^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Send {__task_task}` |
| 113 | | | 111 | | |
| 114 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` | 112 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` |
| 115 | note: required by a bound in `__task_pool_get` | 113 | note: required by a bound in `task_pool_new` |
| 116 | --> tests/ui/return_impl_send.rs:3:1 | 114 | --> src/lib.rs |
| 117 | | | 115 | | |
| 118 | 3 | #[embassy_executor::task] | 116 | | pub const fn task_pool_new<F, Args, Fut, const POOL_SIZE: usize>(_: F) -> TaskPool<Fut, POOL_SIZE> |
| 119 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `__task_pool_get` | 117 | | ------------- required by a bound in this function |
| 120 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) | 118 | | where |
| 119 | | F: TaskFn<Args, Fut = Fut>, | ||
| 120 | | ^^^^^^^^^ required by this bound in `task_pool_new` | ||
| 121 | 121 | ||
| 122 | error[E0277]: `impl Send` is not a future | 122 | error[E0277]: task futures must resolve to `()` or `!` |
| 123 | --> tests/ui/return_impl_send.rs:3:1 | 123 | --> tests/ui/return_impl_send.rs:3:1 |
| 124 | | | 124 | | |
| 125 | 3 | #[embassy_executor::task] | 125 | 3 | #[embassy_executor::task] |
| 126 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ `impl Send` is not a future | 126 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TaskFn<_>` is not implemented for fn item `fn() -> impl Send {__task_task}` |
| 127 | | | 127 | | |
| 128 | = help: the trait `Future` is not implemented for `impl Send` | 128 | = note: use `async fn` or change the return type to `impl Future<Output = ()>` |
| 129 | note: required by a bound in `TaskPool::<F, N>::_spawn_async_fn` | 129 | note: required by a bound in `task_pool_new` |
| 130 | --> src/raw/mod.rs | 130 | --> src/lib.rs |
| 131 | | | 131 | | |
| 132 | | impl<F: Future + 'static, const N: usize> TaskPool<F, N> { | 132 | | pub const fn task_pool_new<F, Args, Fut, const POOL_SIZE: usize>(_: F) -> TaskPool<Fut, POOL_SIZE> |
| 133 | | ^^^^^^ required by this bound in `TaskPool::<F, N>::_spawn_async_fn` | 133 | | ------------- required by a bound in this function |
| 134 | ... | 134 | | where |
| 135 | | pub unsafe fn _spawn_async_fn<FutFn>(&'static self, future: FutFn) -> SpawnToken<impl Sized> | 135 | | F: TaskFn<Args, Fut = Fut>, |
| 136 | | --------------- required by a bound in this associated function | 136 | | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `task_pool_new` |
| 137 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) | 137 | = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) |
