Skip to content

Commit 02d78c3

Browse files
committed
fix: Improve hint of lifetimes2
fixes #1071
1 parent 7035d67 commit 02d78c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

info.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,10 @@ name = "lifetimes2"
795795
path = "exercises/lifetimes/lifetimes2.rs"
796796
mode = "compile"
797797
hint = """
798-
What is the compiler checking? How could you change how long an owned variable lives?"""
798+
Remember that the generic lifetime 'a will get the concrete lifetime that is equal to the smaller of the lifetimes of x and y.
799+
You can take at leats two paths to achieve the desidered result while keeping the inner block:
800+
1. move string2 declaration to make it live as long as string1 (how is result declared?)
801+
2. move println! into the inner block"""
799802

800803
[[exercises]]
801804
name = "lifetimes3"

0 commit comments

Comments
 (0)