Skip to content
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

RFC 1214 warning in libstd/thread/mod.rs #29128

Closed
apasel422 opened this issue Oct 17, 2015 · 0 comments
Closed

RFC 1214 warning in libstd/thread/mod.rs #29128

apasel422 opened this issue Oct 17, 2015 · 0 comments

Comments

@apasel422
Copy link
Contributor

As a result of #29110, there is now an RFC 1214 warning in the spawn_inner function on line 283 of libstd/thread/mod.rs:

../rust/src/libstd/thread/mod.rs:283:27: 283:32 warning: the parameter type `T` may not live long enough [E0310]
../rust/src/libstd/thread/mod.rs:283             *their_packet.get() = Some(try_result.map(|()| {
                                                               ^~~~~
../rust/src/libstd/thread/mod.rs:283:27: 283:32 help: run `rustc --explain E0310` to see a detailed explanation
../rust/src/libstd/thread/mod.rs:283:27: 283:32 help: consider adding an explicit lifetime bound `T: 'static`...
../rust/src/libstd/thread/mod.rs:283:27: 283:32 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
../rust/src/libstd/thread/mod.rs:283             *their_packet.get() = Some(try_result.map(|()| {
                                                               ^~~~~
../rust/src/libstd/thread/mod.rs:283:27: 283:32 note: ...so that the reference type `&alloc::arc::Arc<core::cell::UnsafeCell<core::option::Option<core::result::Result<T, Box<core::any::Any + Send>>>>>` does not outlive the data it points at
../rust/src/libstd/thread/mod.rs:283             *their_packet.get() = Some(try_result.map(|()| {
                                                               ^~~~~
../rust/src/libstd/thread/mod.rs:283:27: 283:32 warning: the parameter type `T` may not live long enough [E0310]
../rust/src/libstd/thread/mod.rs:283             *their_packet.get() = Some(try_result.map(|()| {
                                                               ^~~~~
../rust/src/libstd/thread/mod.rs:283:27: 283:32 help: run `rustc --explain E0310` to see a detailed explanation
../rust/src/libstd/thread/mod.rs:283:27: 283:32 help: consider adding an explicit lifetime bound `T: 'static`...
../rust/src/libstd/thread/mod.rs:283:27: 283:32 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.
../rust/src/libstd/thread/mod.rs:283             *their_packet.get() = Some(try_result.map(|()| {
                                                               ^~~~~
../rust/src/libstd/thread/mod.rs:283:27: 283:32 note: ...so that the reference type `&core::cell::UnsafeCell<core::option::Option<core::result::Result<T, Box<core::any::Any + Send>>>>` does not outlive the data it points at
../rust/src/libstd/thread/mod.rs:283             *their_packet.get() = Some(try_result.map(|()| {
                                                               ^~~~~

CC @arielb1.

bors added a commit that referenced this issue Oct 19, 2015
Fixes #29128

Most of the weird lifetime things and `inner` stuff seems like leftover cruft from `thread::scoped`. Should `JoinInner` just be removed/merged with `JoinHandle`?

Also is it okay to remove the `FnBox`? I'm not really sure why there were two allocations there...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant