DEV Community


Posted on

Answer: Why can't I assign one dereference of a reference of a reference to another when the outer lifetimes differ?

You cannot dereference a &'b mut &'c mut u32 and get a &'c mut u32 because:

  • &mut references are not trivially copiable, so you can't copy the &'c mut u32; and
  • You cannot move out of a reference, so you also can't move the &'c mut u32 (which would…

Top comments (0)