mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-10 00:44:21 +02:00
6115a12554
The example of returning a reference to a local variable doesn't compile due to a missing lifetime specifier, which isn't what we're trying to demonstrate with that example. I usually add the lifetime in manually in order to demonstrate the compiler error, but it occurs to me that if we make the argument a reference we can sneakily get the correct compiler error without having to introduce the lifetime syntax. |
||
---|---|---|
.. | ||
Cargo.toml | ||
exclusive.md | ||
exercise.md | ||
exercise.rs | ||
shared.md | ||
slices.md | ||
solution.md | ||
strings.md |