We actually can’t implement a scheme like this, at least not with the current type system. However, non-lexical lifetimes would result in many of the same effects.
Let me explain starting with your first example:
fn main() {
let data = [1, 2, 3];
let m = &mut data;
let i = &data; // proposal is to have this invalidate "m"
}
The problem is that the current type system has no “reverse mapping” from data to m. In other words, we don’t know the precise set of pointers that might be pointing at bits of data. For example, imagine:
let m = &mut data;
let (m1, m2) = foo(m);
let n = &data;
fn foo(m: &mut Data) -> (&mut u8, &mut u8) { (&mut m.f, &mut m.g) } // assuming some suitable `Data` def'n
Here, the borrow of n would have to invalidate m1 and m2. It’s not that it’s impossible to define the set of things that might be pointing into data, but the current lifetime system doesn’t work that way. It tracks that data is borrowed for a particular period of time, but makes no effort to track how the data in that reference threads its way around. (To make things more fun, it’s also good to think about what happens you include unsafe pointers etc.)
However, the NLL proposal would (in this particular example) achieve the same effect by making the borrow of m shorter (since it is not used later).
Now, there are alternative systems that would work more like what you described. In that system, you wouldn’t assign a reference a lifetime, but instead you would assign to each reference a set of paths – those paths are basically a “points-to” set. So, in that case, the type of m would be &{data} mut Data (and the type of m1 and m2 would be &{data} mut u8). Now when data is reborrowed, we can know what to invalidate.
As part of thinking about NLL I also pursued this line of thinking. I find it appealing in some ways. I’ve been meaning to write up my results. I found that it is largely equivalent, but there are corner cases where you can see different behavior. I believe it would not be strictly backwards compatible, and I think that lifetimes can be more expressive – but I’d like to investigate more. Would be a good topic for a blog post!