rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.75k stars 258 forks source link

update lifetime-elision to show what elided code under `rust_2018_idioms` looks like #306

Closed guswynn closed 2 years ago

guswynn commented 2 years ago

This was a bit confusing for me to read, as it was using an old style of rust that I am not used to Unfortunately, this lint group isn't on by default, but I think elided_lifetimes_in_paths may be on track to be deny-by-default in edition 2021?

ehuss commented 2 years ago

FWIW, I think it might be worthwhile to consider removing this chapter completely and just point it to https://doc.rust-lang.org/nightly/reference/lifetime-elision.html, since there is a large amount of duplication (and, for example, the reference already has this change). If there is information here that is not in the reference, perhaps it could be moved over.

guswynn commented 2 years ago

@ehuss oh thats a great idea, google offered this link first when I googled "rust lifetime elision" unfortunately