You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The i_work function is there to emphasize that associated types coming from traits with lifetimes seem to be getting treated weirdly. I don't know what's happening, but I'd have expected that if i_fail failed, so'd i_work...
Error
<anon>:11:9: 11:20 error: borrowed value does not live long enough
<anon>:11 self.my_a().i_fail();
^~~~~~~~~~~
<anon>:11:9: 11:30 note: reference must be valid for the destruction scope surrounding statement at 11:8...
<anon>:11 self.my_a().i_fail();
^~~~~~~~~~~~~~~~~~~~~
<anon>:11:9: 11:30 note: ...but borrowed value is only valid for the statement at 11:8
<anon>:11 self.my_a().i_fail();
^~~~~~~~~~~~~~~~~~~~~
<anon>:11:9: 11:30 help: consider using a `let` binding to increase its lifetime
<anon>:11 self.my_a().i_fail();
^~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101
The text was updated successfully, but these errors were encountered:
soltanmm
changed the title
HKL-bound associated type's associated type as return makes function call temporary not live through its statement
HKL-bound associated type's associated type as return makes function call's temporary receiver not live through its statement
Dec 28, 2015
play-pen
The
i_work
function is there to emphasize that associated types coming from traits with lifetimes seem to be getting treated weirdly. I don't know what's happening, but I'd have expected that ifi_fail
failed, so'di_work
...Error
The text was updated successfully, but these errors were encountered: