cognitive-engineering-lab / rust-book

The Rust Programming Language: Experimental Edition
https://rust-book.cs.brown.edu
Other
504 stars 82 forks source link

Incorrect wording in chapter 10.3 #102

Closed eliasazarian closed 11 months ago

eliasazarian commented 12 months ago

URL to the section(s) of the book with this problem: https://rust-book.cs.brown.edu/ch10-03-lifetime-syntax.html Description of the problem: The lifetime parameter declaration after impl and its use after the type name are required, but we’re not required to annotate the lifetime of the reference to self because of the first elision rule. Suggested fix: The lifetime parameter declaration after impl and its use after the type name are required, but we’re not required to annotate the lifetime of the reference to self because of the third elision rule.

willcrichton commented 11 months ago

This would not be a case of the third elision rule, which describes the lifetimes out of output references, not input references.