Oxide: A Formal Semantics for Rust
One of the examples in the paper has some code that you can't actually write in Rust, it's close to this:<p><pre><code>    let msg: &'msg str = "Hello World";
</code></pre>
You can write something similar and allow the compiler to infer the lifetime:<p><pre><code>    let msg: &'_ str = "Hello World";
</code></pre>
I often find myself declaring the type when I get into confusing type issues in Rust, but you can't do that as easily with lifetimes. With non-lexical lifetimes this has been less of an issue, but still there are times when I would like to be able to declare the lifetime like the first example.<p>This error example shows the valid uses of lifetimes: <a href="https://doc.rust-lang.org/nightly/error-index.html#E0261" rel="nofollow">https://doc.rust-lang.org/nightly/error-index.html#E0261</a>