Skip to content

Commit a91b16f

Browse files
committed
Fix in-band lifetimes example with backreferences
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)).
1 parent 74d4623 commit a91b16f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

text/2115-argument-lifetimes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ tomorrow you would write:
334334

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

340340
impl MyStruct<'A> {
341341
fn foo(&self) -> &'A str

0 commit comments

Comments
 (0)