Update UI tests, 1 failing that needs fixing

This commit is contained in:
Emil Fresk 2023-01-08 16:25:46 +01:00 committed by Henrik Tjäder
parent 9a4f97ca5e
commit 584ac7e1b3
91 changed files with 134 additions and 350 deletions

View file

@ -1,28 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[shared]
struct Shared {
#[lock_free]
e: u32,
}
#[local]
struct Local {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
// e ok
#[task(priority = 1, shared = [e])]
fn uart0(cx: uart0::Context) {}
// e ok
#[task(priority = 1, shared = [e])]
fn uart1(cx: uart1::Context) {}
// e not ok
#[task(priority = 1, shared = [e])]
async fn async_task(cx: async_task::Context) {}
}

View file

@ -1,5 +0,0 @@
error: Lock free shared resource "e" is used by an async tasks, which is forbidden
--> ui/async-local-resouces.rs:26:36
|
26 | #[task(priority = 1, shared = [e])]
| ^

View file

@ -1,11 +0,0 @@
error: Software task "foo" has priority 0, but `#[idle]` is defined. 0-priority software tasks are only allowed if there is no `#[idle]`.
--> ui/async-zero-prio-tasks.rs:15:8
|
15 | fn foo(_: foo::Context) {}
| ^^^
error: Software task "foo" has priority 0, but is not `async`. 0-priority software tasks must be `async`.
--> ui/async-zero-prio-tasks.rs:15:8
|
15 | fn foo(_: foo::Context) {}
| ^^^

View file

@ -9,7 +9,7 @@ mod app {
struct Local {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
#[task(binds = EXTI0)]
fn foo(_: foo::Context) {}

View file

@ -1,5 +1,5 @@
error: dispatcher interrupts can't be used as hardware tasks
--> $DIR/extern-interrupt-used.rs:14:20
--> ui/extern-interrupt-used.rs:14:20
|
14 | #[task(binds = EXTI0)]
| ^^^^^

View file

@ -1,5 +1,5 @@
error: argument appears more than once
--> $DIR/idle-double-local.rs:5:25
--> ui/idle-double-local.rs:5:25
|
5 | #[idle(local = [A], local = [B])]
| ^^^^^

View file

@ -1,5 +1,5 @@
error: argument appears more than once
--> $DIR/idle-double-shared.rs:5:26
--> ui/idle-double-shared.rs:5:26
|
5 | #[idle(shared = [A], shared = [B])]
| ^^^^^^

View file

@ -1,5 +1,5 @@
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
--> $DIR/init-divergent.rs:12:8
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct)`
--> ui/init-divergent.rs:12:8
|
12 | fn init(_: init::Context) -> ! {}
| ^^^^

View file

@ -1,5 +1,5 @@
error: argument appears more than once
--> $DIR/init-double-local.rs:5:25
--> ui/init-double-local.rs:5:25
|
5 | #[init(local = [A], local = [B])]
| ^^^^^

View file

@ -1,5 +1,5 @@
error: unexpected argument
--> $DIR/init-double-shared.rs:5:12
--> ui/init-double-shared.rs:5:12
|
5 | #[init(shared = [A], shared = [B])]
| ^^^^^^

View file

@ -9,5 +9,5 @@ mod app {
struct Local {}
#[init]
fn init(_: init::Context, _undef: u32) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context, _undef: u32) -> (Shared, Local) {}
}

View file

@ -1,5 +1,5 @@
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
--> $DIR/init-input.rs:12:8
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct)`
--> ui/init-input.rs:12:8
|
12 | fn init(_: init::Context, _undef: u32) -> (Shared, Local, init::Monotonics) {}
12 | fn init(_: init::Context, _undef: u32) -> (Shared, Local) {}
| ^^^^

View file

@ -9,5 +9,5 @@ mod app {
struct Local {}
#[init]
fn init() -> (Shared, Local, init::Monotonics) {}
fn init() -> (Shared, Local) {}
}

View file

@ -1,5 +1,5 @@
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
--> $DIR/init-no-context.rs:12:8
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct)`
--> ui/init-no-context.rs:12:8
|
12 | fn init() -> (Shared, Local, init::Monotonics) {}
12 | fn init() -> (Shared, Local) {}
| ^^^^

View file

@ -1,5 +1,5 @@
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
--> $DIR/init-output.rs:6:8
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct)`
--> ui/init-output.rs:6:8
|
6 | fn init(_: init::Context) -> u32 {
| ^^^^

View file

@ -9,5 +9,5 @@ mod app {
struct Local {}
#[init]
pub fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
pub fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -1,5 +1,5 @@
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
--> $DIR/init-pub.rs:12:12
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct)`
--> ui/init-pub.rs:12:12
|
12 | pub fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
12 | pub fn init(_: init::Context) -> (Shared, Local) {}
| ^^^^

View file

@ -3,5 +3,5 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[init]
unsafe fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
unsafe fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -1,5 +1,5 @@
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
--> $DIR/init-unsafe.rs:6:15
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct)`
--> ui/init-unsafe.rs:6:15
|
6 | unsafe fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
6 | unsafe fn init(_: init::Context) -> (Shared, Local) {}
| ^^^^

View file

@ -1,5 +1,5 @@
error: this interrupt is already bound
--> $DIR/interrupt-double.rs:8:20
--> ui/interrupt-double.rs:8:20
|
8 | #[task(binds = UART0)]
| ^^^^^

View file

@ -10,12 +10,9 @@ mod app {
a: u32,
}
fn bar(_: bar::Context) {}
#[task(local = [a: u8 = 3])]
fn bar(_: bar::Context) {}
async fn bar(_: bar::Context) {}
#[init(local = [a: u16 = 2])]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -1,17 +1,17 @@
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
--> $DIR/local-collision-2.rs:10:9
--> ui/local-collision-2.rs:10:9
|
10 | a: u32,
| ^
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
--> $DIR/local-collision-2.rs:18:21
--> ui/local-collision-2.rs:16:21
|
18 | #[init(local = [a: u16 = 2])]
16 | #[init(local = [a: u16 = 2])]
| ^
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
--> $DIR/local-collision-2.rs:15:21
--> ui/local-collision-2.rs:13:21
|
15 | #[task(local = [a: u8 = 3])]
13 | #[task(local = [a: u8 = 3])]
| ^

View file

@ -11,11 +11,11 @@ mod app {
}
#[task(local = [a])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
#[task(local = [a: u8 = 3])]
fn bar(_: bar::Context) {}
async fn bar(_: bar::Context) {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -1,11 +1,11 @@
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
--> $DIR/local-collision.rs:10:9
--> ui/local-collision.rs:10:9
|
10 | a: u32,
| ^
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
--> $DIR/local-collision.rs:16:21
--> ui/local-collision.rs:16:21
|
16 | #[task(local = [a: u8 = 3])]
| ^

View file

@ -9,8 +9,8 @@ mod app {
struct Local {}
#[task(local = [a:])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -9,8 +9,8 @@ mod app {
struct Local {}
#[task(local = [a: u32])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -2,4 +2,4 @@ error: malformed, expected 'IDENT: TYPE = EXPR'
--> ui/local-malformed-2.rs:11:21
|
11 | #[task(local = [a: u32])]
| ^
| ^^^^^^

View file

@ -9,8 +9,8 @@ mod app {
struct Local {}
#[task(local = [a: u32 =])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -9,8 +9,8 @@ mod app {
struct Local {}
#[task(local = [a = u32])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -9,8 +9,8 @@ mod app {
struct Local {}
#[task(local = [A])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -1,5 +1,5 @@
error: this local resource has NOT been declared
--> $DIR/local-not-declared.rs:11:21
--> ui/local-not-declared.rs:11:21
|
11 | #[task(local = [A])]
| ^

View file

@ -2,8 +2,14 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[shared]
struct Shared {}
#[local]
struct Local {
pub x: u32,
}
#[init]
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -1,5 +1,5 @@
error: this field must have inherited / private visibility
--> $DIR/local-pub.rs:7:13
|
7 | pub x: u32,
| ^
--> ui/local-pub.rs:10:13
|
10 | pub x: u32,
| ^

View file

@ -2,13 +2,20 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[shared]
struct Shared {}
#[local]
struct Local {}
#[init]
fn init(_: init::Context) -> (Shared, Local) {}
#[task(local = [
#[test]
a: u32 = 0, // Ok
#[test]
b, // Error
])]
fn foo(_: foo::Context) {
}
fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,6 @@
error: attributes are not supported here
--> $DIR/local-shared-attribute.rs:8:9
|
8 | #[test]
| ^
--> ui/local-shared-attribute.rs:17:9
|
17 | / #[test]
18 | | b, // Error
| |_________^

View file

@ -12,7 +12,7 @@ mod app {
}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
// l2 ok
#[idle(local = [l2])]
@ -20,9 +20,9 @@ mod app {
// l1 rejected (not local)
#[task(priority = 1, local = [l1])]
fn uart0(cx: uart0::Context) {}
async fn uart0(cx: uart0::Context) {}
// l1 rejected (not lock_free)
#[task(priority = 2, local = [l1])]
fn uart1(cx: uart1::Context) {}
async fn uart1(cx: uart1::Context) {}
}

View file

@ -1,11 +1,11 @@
error: Local resource "l1" is used by multiple tasks or collides with multiple definitions
--> $DIR/local-shared.rs:22:35
--> ui/local-shared.rs:22:35
|
22 | #[task(priority = 1, local = [l1])]
| ^^
error: Local resource "l1" is used by multiple tasks or collides with multiple definitions
--> $DIR/local-shared.rs:26:35
--> ui/local-shared.rs:26:35
|
26 | #[task(priority = 2, local = [l1])]
| ^^

View file

@ -1,10 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic(binds = Tim1)]
type Fast1 = hal::Tim1Monotonic;
#[task(binds = Tim1)]
fn foo(_: foo::Context) {}
}

View file

@ -1,5 +0,0 @@
error: this interrupt is already bound
--> $DIR/monotonic-binds-collision-task.rs:8:20
|
8 | #[task(binds = Tim1)]
| ^^^^

View file

@ -1,10 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic(binds = Tim1)]
type Fast1 = hal::Tim1Monotonic;
#[monotonic(binds = Tim1)]
type Fast2 = hal::Tim2Monotonic;
}

View file

@ -1,5 +0,0 @@
error: this interrupt is already bound
--> $DIR/monotonic-binds-collision.rs:8:25
|
8 | #[monotonic(binds = Tim1)]
| ^^^^

View file

@ -1,7 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic(binds = Tim1, binds = Tim2)]
type Fast = hal::Tim1Monotonic;
}

View file

@ -1,5 +0,0 @@
error: argument appears more than once
--> $DIR/monotonic-double-binds.rs:5:31
|
5 | #[monotonic(binds = Tim1, binds = Tim2)]
| ^^^^^

View file

@ -1,7 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic(binds = Tim1, default = true, default = false)]
type Fast = hal::Tim1Monotonic;
}

View file

@ -1,5 +0,0 @@
error: argument appears more than once
--> $DIR/monotonic-double-default.rs:5:47
|
5 | #[monotonic(binds = Tim1, default = true, default = false)]
| ^^^^^^^

View file

@ -1,7 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic(binds = Tim1, priority = 1, priority = 2)]
type Fast = hal::Tim1Monotonic;
}

View file

@ -1,5 +0,0 @@
error: argument appears more than once
--> $DIR/monotonic-double-prio.rs:5:45
|
5 | #[monotonic(binds = Tim1, priority = 1, priority = 2)]
| ^^^^^^^^

View file

@ -1,10 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic(binds = Tim1)]
type Fast = hal::Tim1Monotonic;
#[monotonic(binds = Tim1)]
type Fast = hal::Tim1Monotonic;
}

View file

@ -1,5 +0,0 @@
error: `#[monotonic(...)]` on a specific type must appear at most once
--> ui/monotonic-double.rs:9:10
|
9 | type Fast = hal::Tim1Monotonic;
| ^^^^

View file

@ -1,10 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic(binds = Tim1)]
type Fast1 = hal::Tim1Monotonic;
#[monotonic(binds = Tim2)]
type Fast1 = hal::Tim2Monotonic;
}

View file

@ -1,5 +0,0 @@
error: `#[monotonic(...)]` on a specific type must appear at most once
--> ui/monotonic-name-collision.rs:9:10
|
9 | type Fast1 = hal::Tim2Monotonic;
| ^^^^^

View file

@ -1,7 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic()]
type Fast = hal::Tim1Monotonic;
}

View file

@ -1,5 +0,0 @@
error: `binds = ...` is missing
--> $DIR/monotonic-no-binds.rs:5:17
|
5 | #[monotonic()]
| ^

View file

@ -1,8 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic]
type Fast = hal::Tim1Monotonic;
}

View file

@ -1,5 +0,0 @@
error: expected opening ( in #[monotonic( ... )]
--> ui/monotonic-no-paran.rs:5:7
|
5 | #[monotonic]
| ^^^^^^^^^

View file

@ -1,10 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[monotonic(binds = Tim1)]
type Fast1 = hal::Tim1Monotonic;
#[monotonic(binds = Tim2)]
type Fast2 = hal::Tim1Monotonic;
}

View file

@ -1,5 +0,0 @@
error: this type is already used by another monotonic
--> $DIR/monotonic-timer-collision.rs:9:18
|
9 | type Fast2 = hal::Tim1Monotonic;
| ^^^

View file

@ -1,8 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[no_mangle]
#[monotonic(binds = Tim1)]
type Fast = hal::Tim1Monotonic;
}

View file

@ -1,5 +0,0 @@
error: Monotonic does not support attributes other than `#[cfg]`
--> $DIR/monotonic-with-attrs.rs:5:7
|
5 | #[no_mangle]
| ^^^^^^^^^

View file

@ -1,5 +0,0 @@
error: this field must have inherited / private visibility
--> $DIR/pub-local.rs:7:13
|
7 | pub x: u32,
| ^

View file

@ -1,5 +0,0 @@
error: this field must have inherited / private visibility
--> $DIR/pub-shared.rs:7:13
|
7 | pub x: u32,
| ^

View file

@ -17,7 +17,7 @@ mod app {
struct Local {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
// e2 ok
#[idle(shared = [e2])]
@ -27,12 +27,12 @@ mod app {
}
// e1 rejected (not lock_free)
#[task(priority = 1, shared = [e1])]
#[task(binds = UART0, priority = 1, shared = [e1])]
fn uart0(cx: uart0::Context) {
*cx.resources.e1 += 10;
}
// e1 rejected (not lock_free)
#[task(priority = 2, shared = [e1])]
#[task(binds = UART1, priority = 2, shared = [e1])]
fn uart1(cx: uart1::Context) {}
}

View file

@ -1,17 +0,0 @@
error: Lock free shared resource "e1" is used by tasks at different priorities
--> $DIR/shared-lock-free.rs:9:9
|
9 | e1: u32,
| ^^
error: Shared resource "e1" is declared lock free but used by tasks at different priorities
--> $DIR/shared-lock-free.rs:30:36
|
30 | #[task(priority = 1, shared = [e1])]
| ^^
error: Shared resource "e1" is declared lock free but used by tasks at different priorities
--> $DIR/shared-lock-free.rs:36:36
|
36 | #[task(priority = 2, shared = [e1])]
| ^^

View file

@ -9,8 +9,8 @@ mod app {
struct Local {}
#[task(shared = [A])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
}

View file

@ -1,5 +1,5 @@
error: this shared resource has NOT been declared
--> $DIR/shared-not-declared.rs:11:22
--> ui/shared-not-declared.rs:11:22
|
11 | #[task(shared = [A])]
| ^

View file

@ -1,5 +1,5 @@
error: this field must have inherited / private visibility
--> $DIR/shared-pub.rs:7:13
--> ui/shared-pub.rs:7:13
|
7 | pub x: u32,
| ^

View file

@ -3,7 +3,7 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task]
fn foo(_: foo::Context) -> ! {
async fn foo(_: foo::Context) -> ! {
loop {}
}
}

View file

@ -1,5 +1,5 @@
error: this task handler must have type signature `(async) fn(foo::Context, ..)`
--> ui/task-divergent.rs:6:8
error: this task handler must have type signature `async fn(foo::Context)`
--> ui/task-divergent.rs:6:14
|
6 | fn foo(_: foo::Context) -> ! {
| ^^^
6 | async fn foo(_: foo::Context) -> ! {
| ^^^

View file

@ -1,7 +0,0 @@
#![no_main]
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task(capacity = 1, capacity = 2)]
fn foo(_: foo::Context) {}
}

View file

@ -1,5 +0,0 @@
error: argument appears more than once
--> $DIR/task-double-capacity.rs:5:26
|
5 | #[task(capacity = 1, capacity = 2)]
| ^^^^^^^^

View file

@ -3,5 +3,5 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task(local = [A], local = [B])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,5 @@
error: argument appears more than once
--> $DIR/task-double-local.rs:5:25
--> ui/task-double-local.rs:5:25
|
5 | #[task(local = [A], local = [B])]
| ^^^^^

View file

@ -3,5 +3,5 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task(priority = 1, priority = 2)]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,5 @@
error: argument appears more than once
--> $DIR/task-double-priority.rs:5:26
--> ui/task-double-priority.rs:5:26
|
5 | #[task(priority = 1, priority = 2)]
| ^^^^^^^^

View file

@ -3,5 +3,5 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task(shared = [A], shared = [B])]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,5 @@
error: argument appears more than once
--> $DIR/task-double-shared.rs:5:26
--> ui/task-double-shared.rs:5:26
|
5 | #[task(shared = [A], shared = [B])]
| ^^^^^^

View file

@ -9,5 +9,5 @@ mod app {
// name collides with `#[idle]` function
#[task]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,5 @@
error: this identifier has already been used
--> $DIR/task-idle.rs:12:8
--> ui/task-idle.rs:12:14
|
12 | fn foo(_: foo::Context) {}
| ^^^
12 | async fn foo(_: foo::Context) {}
| ^^^

View file

@ -9,9 +9,9 @@ mod app {
struct Local {}
#[init]
fn foo(_: foo::Context) -> (Shared, Local, foo::Monotonics) {}
fn foo(_: foo::Context) -> (Shared, Local) {}
// name collides with `#[idle]` function
#[task]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,5 @@
error: this identifier has already been used
--> $DIR/task-init.rs:16:8
--> ui/task-init.rs:16:14
|
16 | fn foo(_: foo::Context) {}
| ^^^
16 | async fn foo(_: foo::Context) {}
| ^^^

View file

@ -6,5 +6,5 @@ mod app {
fn foo(_: foo::Context) {}
#[task]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,5 @@
error: this task is defined multiple times
--> $DIR/task-interrupt.rs:9:8
--> ui/task-interrupt.rs:9:14
|
9 | fn foo(_: foo::Context) {}
| ^^^
9 | async fn foo(_: foo::Context) {}
| ^^^

View file

@ -3,5 +3,5 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task]
fn foo() {}
async fn foo() {}
}

View file

@ -1,5 +1,5 @@
error: this task handler must have type signature `(async) fn(foo::Context, ..)`
--> ui/task-no-context.rs:6:8
error: this task handler must have type signature `async fn(foo::Context)`
--> ui/task-no-context.rs:6:14
|
6 | fn foo() {}
| ^^^
6 | async fn foo() {}
| ^^^

View file

@ -3,5 +3,5 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task(priority = 256)]
fn foo(_: foo::Context) {}
async fn foo(_: foo::Context) {}
}

View file

@ -3,5 +3,5 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task]
pub fn foo(_: foo::Context) {}
pub async fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,5 @@
error: this task handler must have type signature `(async) fn(foo::Context, ..)`
--> ui/task-pub.rs:6:12
error: this task handler must have type signature `async fn(foo::Context)`
--> ui/task-pub.rs:6:18
|
6 | pub fn foo(_: foo::Context) {}
| ^^^
6 | pub async fn foo(_: foo::Context) {}
| ^^^

View file

@ -3,5 +3,5 @@
#[rtic_macros::mock_app(device = mock)]
mod app {
#[task]
unsafe fn foo(_: foo::Context) {}
async unsafe fn foo(_: foo::Context) {}
}

View file

@ -1,5 +1,5 @@
error: this task handler must have type signature `(async) fn(foo::Context, ..)`
--> ui/task-unsafe.rs:6:15
error: this task handler must have type signature `async fn(foo::Context)`
--> ui/task-unsafe.rs:6:21
|
6 | unsafe fn foo(_: foo::Context) {}
| ^^^
6 | async unsafe fn foo(_: foo::Context) {}
| ^^^

View file

@ -9,7 +9,7 @@ mod app {
struct Local {}
#[init]
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
fn init(_: init::Context) -> (Shared, Local) {}
#[task(priority = 0)]
fn foo(_: foo::Context) {}

View file

@ -0,0 +1,5 @@
error: this task handler must have type signature `async fn(foo::Context)`
--> ui/task-zero-prio.rs:15:8
|
15 | fn foo(_: foo::Context) {}
| ^^^