-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RWops does not live long enough #696
Comments
Try to remove your init_music function and put it in he main, and tell me how it goes. It looks like this is more of a Rust lifetime problem than an SDL2 problem. For questions like this, I'd advise you to ask #rust or #rust-beginners, they will be able to help you much faster than I do :) |
Putting it directly in I spoke with someone on the #rust channel and he explained more about how lifetimes work. Apparently lifetimes aren't transitive like I thought. If the contents of a What I need is a |
Solved by #704. |
Any idea when #704 will be published to crates.io? |
I've got 2 PRs to merge before that, I'm planning to do it this week end or at the latest next week end.
…On Sep 21, 2017, 17:38, at 17:38, Flaise ***@***.***> wrote:
Any idea when #704 will be published to crates.io?
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#696 (comment)
|
I'm trying to store a
mixer::Music
instance in a data structure for later retrieval. The data structure expects its contents to have the'static
lifetime because it uses standard library functions likeTypeId::of
and such that require it. I'm having trouble making it work.The compiler gives this error:
You'll notice that
init_music
already stipulates that the original source of its data lives for the'static
lifetime and the implementation of theMusic
andRWops
structs look to me like they should take the same lifetime asbytes
. The lifetime parameter ofMusicData
is supposed to specify thatbuffer
lives as long asmusic
. But that's not what the compiler is saying. I'm confused. Can you help?The text was updated successfully, but these errors were encountered: