1. 28
  1. 5

    Honestly, point # 8 should be directly in the Rust book. And the whole article is amazing.

    Corollary – has anyone ever explored the possibility of an editor plugin or code formatter that graphically, explicitly shows the lifetimes inferred by the compiler? (I imagine it would be much more complex than it sounds … maybe not even feasible).

    1. 3

      I have wanted this. If the error string can show you the borrow points, you should be able to get that data in the editor.

    2. 2

      That’s a good collection. I’ve seen people struggle with these cases. It’s necessary to have a correct mental model of how lifetimes work to avoid “fighting the borrow checker”.

      Stories with similar links:

      1. Common Rust Lifetime Misconceptions via sri 5 months ago | 16 points | no comments