Skip to content

Don't place a raw pointer in a static. #5

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

eddyb
Copy link

@eddyb eddyb commented Apr 27, 2016

It was only ever allowed because of a bug, see rust-lang/rust#33130.

@SSheldon
Copy link
Owner

Hey @eddyb, thanks for the PR and heads up about this. I'm not sure what to do here in regard to providing familiar bindings to libdispatch.

dispatch_get_main_queue was fine as a function because that one actually is modeled as a static inline function in libdispatch. DISPATCH_QUEUE_CONCURRENT, though, is defined in a macro so accessing it through a function named dispatch_get_attr_concurrent_queue will be a little surprising.

It's still allowed to use a 'static Sync reference in a static, right? I think I'm just going to try changing the type of this to &'static dispatch_object_s for now (which will keep working because that's coerced to *const dispatch_object_s, aka dispatch_queue_attr_t) until a better solution comes along.

@SSheldon
Copy link
Owner

The fix I've applied is in 3d68d46, let me know if that looks like it'll still cause issues.

Thanks a bunch for reaching out about the issue, really appreciate it :)

@eddyb
Copy link
Author

eddyb commented Apr 28, 2016

That works as well, thank you for handling it!

@eddyb eddyb closed this Apr 28, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants