|
|
|
|
|
by duped
490 days ago
|
|
The places where you'll usually see lifetimes creep in where you may not expect are in closures (say your app is one big struct, you call a library function that takes a callback, you reference &self in the callback and get an error that the arg type must be 'static, or some other bound), or if you're spawning async tasks and using locks you may get weird Send/Sync and lifetime errors around await and spawn points. They all make sense if you know why the program doesn't compile, but it may be surprising to newbies. |
|