Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing lifetime error in dangling reference example (#2093)
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.
- Loading branch information