Open gnzlbg opened 7 years ago
This will be a fun one.
We need to collect examples! Many examples. Sooo many examples...
So let's start with my personal favorite:
// BEFORE:
let tmp = self.non_mutating_method();
self.mutating_method(tmp);
// THE FUTURE:
self.mutating_method(self.non_mutating_method());
// ^^ CURRENTLY: something about already borrowed
I can't wait for the future to arrive.
Idk, it's quite often that you want to do something similar (e.g. even when the method doesn't mutate) just for cleaner code.
It'd also be useful to replace uses of RefCell
with ones that become now statically okay.
I like to remind, that Rust 1.31.0 is out and nll is active :) (at least for 2018 workspaces)
Once the NLL RFC is implemented, I'd like to get rid of all lifetime workarounds in a couple of code bases.
It would be great if there would be a lint (or groups of lints) for this. Developing this lints can be done before the RFC is approved, and can be useful to determine / quantify the impact of the RFC on any code base.