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

fix(import) Fix the &'static hack for imported functions #186

Merged
merged 4 commits into from
May 14, 2020

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented May 14, 2020

Closes #185.
Follow up of #140.

Good job @kngwyu and @davidhewitt!

Hywan added 2 commits May 14, 2020 12:15
With Pyo3 0.10, it is now possible to get a proper `'py` lifetime for
the imported functions dict.
@Hywan Hywan added 🐞 bug Something isn't working 🎉 enhancement New feature or request dependencies Pull requests that update a dependency file labels May 14, 2020
@Hywan Hywan self-assigned this May 14, 2020
@Hywan
Copy link
Contributor Author

Hywan commented May 14, 2020

bors r+

bors bot added a commit that referenced this pull request May 14, 2020
186: fix(import) Fix the `&'static` hack for imported functions r=Hywan a=Hywan

Closes #185.
Follow up of #140. 

Good job @kngwyu and @davidhewitt!

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
@davidhewitt
Copy link

Nice! FWIW there's a deadlock in pyO3 0.10.0 which I think will be resolved soon with a patch release, see PyO3/pyo3#924

Also if I can comment on your solution implemented here, Python is currently a zero sized type and implements Copy so you should probably pass it not as a reference. Also did you try to compile without lifetime annotations? I have a feeling you should not need them here.

@bors
Copy link
Contributor

bors bot commented May 14, 2020

Timed out.

@davidhewitt
Copy link

Lol I guess that might have been the deadlock xD

As suggested by @davidhewitt, `Python` is a zero sized type, which can
be copied. So let's copy it. Also, the lifetime `'py` can now be
properly inferred by the borrow checker. Let's enjoy.
@Hywan
Copy link
Contributor Author

Hywan commented May 14, 2020

I don't think it is related to the deadlock, but only Bors being Bors sometimes ;-) (kidding, this tool is awesome).

You're right, the lifetime can now be inferred properly by the borrow checker!

@Hywan Hywan merged commit ffa9c10 into wasmerio:master May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working dependencies Pull requests that update a dependency file 🎉 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants