mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
72 lines
3.5 KiB
Text
72 lines
3.5 KiB
Text
error[E0106]: missing lifetime specifier
|
|
--> ui/task-reference-in-spawn.rs:26:68
|
|
|
|
|
26 | async fn high_prio_print(_: high_prio_print::Context, mut_ref: &mut usize) {
|
|
| ^ expected named lifetime parameter
|
|
|
|
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
|
help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
|
|
|
|
|
26 | async fn high_prio_print(_: high_prio_print::Context, mut_ref: &'static mut usize) {
|
|
| +++++++
|
|
help: consider introducing a named lifetime parameter
|
|
|
|
|
3 ~ #[rtic::app(device = lm3s6965, dispatchers = [SSI0, QEI0, GPIOA])]<'a>
|
|
4 | mod app {
|
|
...
|
|
25 | #[task(priority = 3)]
|
|
26 ~ async fn high_prio_print(_: high_prio_print::Context, mut_ref: &'a usize) {
|
|
|
|
|
help: alternatively, you might want to return an owned value
|
|
|
|
|
26 - async fn high_prio_print(_: high_prio_print::Context, mut_ref: &mut usize) {
|
|
26 + async fn high_prio_print(_: high_prio_print::Context, mut_ref: usize) {
|
|
|
|
|
|
|
error[E0658]: anonymous lifetimes in `impl Trait` are unstable
|
|
--> ui/task-reference-in-spawn.rs:26:69
|
|
|
|
|
26 | async fn high_prio_print(_: high_prio_print::Context, mut_ref: &mut usize) {
|
|
| ^ expected named lifetime parameter
|
|
|
|
|
help: consider introducing a named lifetime parameter
|
|
|
|
|
3 ~ #[rtic::app(device = lm3s6965, dispatchers = [SSI0, QEI0, GPIOA])]<'a>
|
|
4 | mod app {
|
|
...
|
|
25 | #[task(priority = 3)]
|
|
26 ~ async fn high_prio_print(_: high_prio_print::Context, mut_ref: &'a mut usize) {
|
|
|
|
|
|
|
error[E0521]: borrowed data escapes outside of function
|
|
--> ui/task-reference-in-spawn.rs:3:1
|
|
|
|
|
3 | #[rtic::app(device = lm3s6965, dispatchers = [SSI0, QEI0, GPIOA])]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| `_0` is a reference that is only valid in the function body
|
|
| `_0` escapes the function body here
|
|
| argument requires that `'1` must outlive `'static`
|
|
...
|
|
26 | async fn high_prio_print(_: high_prio_print::Context, mut_ref: &mut usize) {
|
|
| - let's call the lifetime of this reference `'1`
|
|
|
|
|
= note: this error originates in the attribute macro `rtic::app` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: lifetime may not live long enough
|
|
--> ui/task-reference-in-spawn.rs:3:1
|
|
|
|
|
3 | #[rtic::app(device = lm3s6965, dispatchers = [SSI0, QEI0, GPIOA])]
|
|
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| let's call the lifetime of this reference `'2`
|
|
| method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
|
|
...
|
|
26 | async fn high_prio_print(_: high_prio_print::Context, mut_ref: &mut usize) {
|
|
| - let's call the lifetime of this reference `'1`
|
|
|
|
|
= note: this error originates in the attribute macro `rtic::app` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
help: consider reusing a named lifetime parameter and update trait if needed
|
|
|
|
|
26 | async fn high_prio_print(_: high_prio_print::Context, mut_ref: &'a mut usize) {
|
|
| ++
|