Skip to content

Commit

Permalink
Fix in-band lifetimes example with backreferences
Browse files Browse the repository at this point in the history
Backreferences are listed as a "possible extension or alternative" in
RFC rust-lang#2115, so the examples should not include them. This is further
reinforced by commit c20ea6d, which
appears to have been intended to remove all instances of
backreferences in the examples, but missed these. [@dhardy also
observed this issue]
(rust-lang#2115 (comment)).
  • Loading branch information
jturner314 committed Jun 23, 2018
1 parent 74d4623 commit a91b16f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions text/2115-argument-lifetimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ tomorrow you would write:

```rust
fn elided(&self) -> &str
fn two_args(arg1: &Foo, arg2: &Bar) -> &'arg2 Baz
fn two_lifetimes(arg1: &Foo, arg2: &Bar) -> &'arg1 Quux<'arg2>
fn two_args(arg1: &Foo, arg2: &'a Bar) -> &'a Baz
fn two_lifetimes(arg1: &'a Foo, arg2: &'b Bar) -> &'a Quux<'b>

impl MyStruct<'A> {
fn foo(&self) -> &'A str
Expand Down

0 comments on commit a91b16f

Please sign in to comment.