Skip to content

Commit

Permalink
Merge pull request rust-lang#1079 from Tostapunk/fix/lifetimes-patch1
Browse files Browse the repository at this point in the history
fix: Improve hint of lifetimes2
  • Loading branch information
shadows-withal authored Jul 18, 2022
2 parents 727fc30 + e1d6abb commit 0e7de2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,10 @@ 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?"""
Remember that the generic lifetime 'a will get the concrete lifetime that is equal to the smaller of the lifetimes of x and y.
You can take at least two paths to achieve the desired result while keeping the inner block:
1. Move the string2 declaration to make it live as long as string1 (how is result declared?)
2. Move println! into the inner block"""

[[exercises]]
name = "lifetimes3"
Expand Down

0 comments on commit 0e7de2e

Please sign in to comment.