ouroboros icon indicating copy to clipboard operation
ouroboros copied to clipboard

Chained mutable borrows broken as of v0.18

Open main-- opened this issue 2 years ago • 0 comments

This works in v0.17.2:

#[ouroboros::self_referencing]
struct Test {
    a: i32,
    #[borrows(mut a)]
    b: &'this i32,
    #[borrows(mut b)]
    c: &'this i32,
}

but in v0.18 it gives the following error:

error[E0392]: parameter `'this1` is never used
 --> src/lib.rs:1:1
  |
1 | #[ouroboros::self_referencing]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused parameter
  |
  = help: consider removing `'this1`, referring to it in a field, or using a marker such as `PhantomData`
  = note: this error originates in the attribute macro `ouroboros::self_referencing` (in Nightly builds, run with -Z macro-backtrace for more info)

main-- avatar Sep 05 '23 10:09 main--