diff options
| author | jayber <james.a.bromley@gmail.com> | 2022-07-15 14:01:32 +0200 |
|---|---|---|
| committer | mokou <mokou@fastmail.com> | 2022-07-15 14:03:38 +0200 |
| commit | 1ef8dacaf69e3ad1418355eeea128c00f09bdcb3 (patch) | |
| tree | ace3826ecdf6f3a6c110bd11477f93d9f4847c70 /info.toml | |
| parent | 1cc5df0e144ef3551062c162e2e1618c27d97ae0 (diff) | |
feat: add lifetimes exercises
Diffstat (limited to 'info.toml')
| -rw-r--r-- | info.toml | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -746,6 +746,30 @@ You can call a function right where you're passing arguments to `assert!` -- so something like `assert!(having_fun())`. If you want to check that you indeed get false, you can negate the result of what you're doing using `!`, like `assert!(!having_fun())`.""" +# LIFETIMES + +[[exercises]] +name = "lifetimes1" +path = "exercises/lifetimes/lifetimes1.rs" +mode = "compile" +hint = """ +Let the compiler guide you. Also take a look at the book if you need help: +https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html""" + +[[exercises]] +name = "lifetimes2" +path = "exercises/lifetimes/lifetimes2.rs" +mode = "compile" +hint = """ +What is the compiler checking? How could you change how long an owned variable lives?""" + +[[exercises]] +name = "lifetimes3" +path = "exercises/lifetimes/lifetimes3.rs" +mode = "compile" +hint = """ +If you use a lifetime annotation in a struct's fields, where else does it need to be added?""" + # STANDARD LIBRARY TYPES [[exercises]] |
