fn get_mut<'a>(&'a mut self) -> &'a mut T;
fn print<'a>(s: &'a str);
The 'a parts are the lifetime annotations.We used to have a single inference rule for when you didn't need to write the annotation. With RFC 39[1], we added two more. These two extra inference rules removed 87% of the existing annotations, giving you this instead:
fn get_mut(&mut self) -> &mut T;
fn print(s: &str);
This is a pretty huge readability win.1: https://github.com/rust-lang/rfcs/blob/master/active/0039-li...
The detailed release notes have a more, er, detailed explanation: https://github.com/rust-lang/rust/wiki/Doc-detailed-release-...
But to clarify, functions which take 2 or more reference inputs won't benefit from this, since the compiler can't determine which lifetime parameter to use, right?
Edit: Never mind, I RTFM. Turns out it can't benefit.
fn f<'a>(x: &'a SomeType) -> &'a OtherType
you can now write this: fn f(x: &SomeType) -> &OtherType
Same meaning, just more concise syntax. fn f<'a>(x: &'a SomeType) -> &'b OtherType
?(Or when it has a lifetime of `static`, which means the referent is stored in static memory and thus is alive for the whole program.)