Skip to content

Commit a6dc582

Browse files
committed
Mention that the elision rules apply to impl blocks
Fixes #1278
1 parent 4a49809 commit a6dc582

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

2018-edition/src/ch10-03-lifetime-syntax.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ and the second and third rules apply to output lifetimes. If the compiler gets
576576
to the end of the three rules and there are still references for which it can’t
577577
figure out lifetimes, the compiler will stop with an error.
578578

579+
These rules apply to `fn` definitions, as well as `impl` blocks.
580+
579581
The first rule is that each parameter that is a reference gets its own lifetime
580582
parameter. In other words, a function with one parameter gets one lifetime
581583
parameter: `fn foo<'a>(x: &'a i32)`; a function with two parameters gets two

0 commit comments

Comments
 (0)