1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-10 00:44:21 +02:00
comprehensive-rust/src/references
Nicole L 6115a12554
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.
2024-05-23 23:27:10 +00:00
..
Cargo.toml Comprehensive Rust v2 (#1073) 2023-11-29 16:39:24 +01:00
exclusive.md Format all Markdown files with dprint (#1157) 2023-12-31 00:15:07 +01:00
exercise.md Tweak timings of exercises to better reflect teaching times (#1839) 2024-02-22 10:21:39 -05:00
exercise.rs Change hardcoded vector update to a for loop (#1833) 2024-02-20 17:29:49 +01:00
shared.md Fix missing lifetime error in dangling reference example (#2093) 2024-05-23 23:27:10 +00:00
slices.md Move slices and strings to references section (#1898) 2024-03-14 16:21:15 -04:00
solution.md Comprehensive Rust v2 (#1073) 2023-11-29 16:39:24 +01:00
strings.md Clarify String definition (#2044) 2024-05-06 16:33:46 +00:00