11# ` '_ ` , the anonymous lifetime
22
3- ![ Minimum Rust version: nightly ] ( https://img.shields.io/badge/Minimum%20Rust%20Version-nightly-red .svg )
3+ ![ Minimum Rust version: 1.31 ] ( https://img.shields.io/badge/Minimum%20Rust%20Version-1.31-brightgreen .svg )
44
55Rust 2018 allows you to explicitly mark where a lifetime is elided, for types
66where this elision might otherwise be unclear. To do this, you can use the
@@ -36,8 +36,6 @@ impl<'a> fmt::Debug for StrWrap<'a> {
3636In Rust 2018, you can instead write:
3737
3838``` rust
39- #![feature(rust_2018_preview)]
40-
4139# use std :: fmt;
4240# struct StrWrap <'a >(& 'a str );
4341
@@ -84,8 +82,6 @@ impl<'a, 'b: 'a> Foo<'a, 'b> {
8482We can rewrite this as:
8583
8684``` rust
87- #![feature(rust_2018_preview)]
88-
8985# struct Foo <'a , 'b : 'a > {
9086# field : & 'a & 'b str ,
9187# }
@@ -100,4 +96,4 @@ impl Foo<'_, '_> {
10096This is the same, because for each ` '_ ` , a fresh lifetime is generated.
10197Finally, the relationship ` 'a: 'b ` which the struct requires must be upheld.
10298
103- For more details, see the [ tracking issue on In-band lifetime bindings] ( https://github.com/rust-lang/rust/issues/44524 ) .
99+ For more details, see the [ tracking issue on In-band lifetime bindings] ( https://github.com/rust-lang/rust/issues/44524 ) .
0 commit comments