Skip to content

Commit 23ad061

Browse files
authored
Merge pull request #142 from ehuss/anonymous-lifetime
Update for anonymous-lifetime stabilization.
2 parents 94ae04d + 306930c commit 23ad061

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/rust-2018/ownership-and-lifetimes/the-anonymous-lifetime.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

55
Rust 2018 allows you to explicitly mark where a lifetime is elided, for types
66
where this elision might otherwise be unclear. To do this, you can use the
@@ -36,8 +36,6 @@ impl<'a> fmt::Debug for StrWrap<'a> {
3636
In 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> {
8482
We 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<'_, '_> {
10096
This is the same, because for each `'_`, a fresh lifetime is generated.
10197
Finally, 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

Comments
 (0)