Hacker News new | ask | show | jobs
by wwright 2703 days ago
My understanding is that the semantics are exactly the same, but it’s just possible for the checker to match your intent more tightly.

For example, in lexical lifetimes, this fails:

    let x = &mut foo;
    
    if x.bar() {
        baz()
    } else {
        foo.consume() // takes foo by value
    }
It will complain that you’ve used `foo` while it is borrowed by `x`, even though a human can easily tell that `x` is already irrelevant by that point. NLL would accept this (I believe).