Skip to content

Conversation

@trembel
Copy link
Contributor

@trembel trembel commented Aug 11, 2025

This commits fixes various warnings on Rust 1.89 because of elided lifetimes as well as usage of div_ceil:

warning: hiding a lifetime that's elided elsewhere is confusing
    --> src/ll.rs:570:36
     |
570  |                   pub fn $name_lower(&mut self) -> RegAccessor<$name, SPI> {
     |                                      ^^^^^^^^^     ----------------------- the same lifetime is hidden here     |                                      |
     |                                      the lifetime is elided here
...
633  | / impl_register! {
634  | |
635  | |     0x00, 0x00, 4, RO, DEV_ID(dev_id) { /// Device identifier
636  | |         rev,     0,  3, u8;  /// Revision
...    |
1653 | | }
     | |_- in this macro invocation
     |
     = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
     = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
     = note: this warning originates in the macro `impl_register` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use `'_` for type paths
     |
570  |                 pub fn $name_lower(&mut self) -> RegAccessor<'_, $name, SPI> {
     |                                                              +++

warning: hiding a lifetime that's elided elsewhere is confusing
    --> src/ll.rs:1682:22
     |
1682 |     pub fn tx_buffer(&mut self) -> RegAccessor<TX_BUFFER, SPI> {
     |                      ^^^^^^^^^     --------------------------- the same lifetime is hidden here
     |                      |
     |                      the lifetime is elided here
     |
     = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
     |
1682 |     pub fn tx_buffer(&mut self) -> RegAccessor<'_, TX_BUFFER, SPI> {
     |                                                +++

warning: hiding a lifetime that's elided elsewhere is confusing
    --> src/ll.rs:1731:24
     |
1731 |     pub fn rx_buffer_0(&mut self) -> RegAccessor<RX_BUFFER_0, SPI> {
     |                        ^^^^^^^^^     ----------------------------- the same lifetime is hidden here
     |                        |
     |                        the lifetime is elided here
     |
     = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
     |
1731 |     pub fn rx_buffer_0(&mut self) -> RegAccessor<'_, RX_BUFFER_0, SPI> {
     |                                                  +++

warning: hiding a lifetime that's elided elsewhere is confusing
    --> src/ll.rs:1792:24
     |
1792 |     pub fn rx_buffer_1(&mut self) -> RegAccessor<RX_BUFFER_1, SPI> {
     |                        ^^^^^^^^^     ----------------------------- the same lifetime is hidden here
     |                        |
     |                        the lifetime is elided here
     |
     = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
     |
1792 |     pub fn rx_buffer_1(&mut self) -> RegAccessor<'_, RX_BUFFER_1, SPI> {
     |                                                  +++

warning: `dw3000-ng` (lib) generated 4 warnings

Signed-off-by: Silvano Cortesi <silvano.cortesi@hotmail.com>
@trembel trembel changed the title [FIX] 'warning: hiding a lifetime that's elided elsewhere is confusing' [FIX] clippy warnings Aug 13, 2025
@ProfFan
Copy link
Owner

ProfFan commented Aug 18, 2025

CI fails?

@trembel
Copy link
Contributor Author

trembel commented Aug 18, 2025

CI fails?

very strange; can't replicate on my PC using Rust 1.89.0... Fixing nevertheless

Signed-off-by: Silvano Cortesi <silvano.cortesi@hotmail.com>
@trembel trembel force-pushed the elided_lifetime_fix branch from d4d4d0b to cd7ca75 Compare August 18, 2025 06:44
@ProfFan
Copy link
Owner

ProfFan commented Aug 20, 2025

[Invalid workflow file: .github/workflows/rust.yml#L1](https://github.com/ProfFan/dw3000-ng/actions/runs/17033146956/workflow)
(Line: 31, Col: 7): 'run' is already defined

@ProfFan ProfFan closed this Oct 20, 2025
@ProfFan ProfFan reopened this Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants