mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-28 00:26:44 +02:00
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.