News for hackers. Stuff that matters.
Re:Fighting the Borrow Checker by barrkel on Monday January 16, 2017 @03:05PM (#13412557)
Indeed, this is the approach taken in many languages with reference counted types.

One problem is that the user would have no way of naming the thing that the lifetime is attached to. Diagnostic messages when trying to hand off 'name' to other code could be perplexing, as the delta between broken code and working code would be larger.

Re:Fighting the Borrow Checker by Groxx on Monday January 16, 2017 @03:26PM (#13412717)
Given their current error messages, that doesn't seem like a problem. If you must name it, call it `name'` or something, but the output could easily be something like

    28 |     let name = jill.name().first_name();
       |                ----------- value returned here
    
    28 |     let name = jill.name().first_name();
       |                           ^^^^^^^^^^^^^ leaves scope before use,
       |                                         and is unavailable here