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

Revert "Allow using 'static lifetimes in functions (#3856)" #3865

Merged
merged 1 commit into from
Mar 2, 2024

Conversation

daxpedda
Copy link
Collaborator

@daxpedda daxpedda commented Mar 2, 2024

This reverts #3856. After some careful thinking about this PR, I don't think it achieves a whole lot.
While it actually enables one more valid signature (fn foo() -> Option<&'static str>), it otherwise achieves little.

Eventually the whole lifetime check should be removed, because we already do "lifetime checks" in the generated code, the check just improves the error message, but prevents some specific uses. So all in all I don't think its worth the tradeoff.

@daxpedda daxpedda requested a review from Liamolucko March 2, 2024 08:10
Copy link
Collaborator

@Liamolucko Liamolucko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually thinking of finishing the job and disabling the 'cannot return references' error for exported functions so that plain &'static T would work; but since you mentioned in #3851 you want to make a new release soon I think it's better to revert this now and fix it properly later than release things in an incomplete state.

@daxpedda daxpedda merged commit 807bdb4 into rustwasm:main Mar 2, 2024
@andreamancuso
Copy link

Hi @daxpedda and @Liamolucko

Is there an open issue I can track for these changes?

Many thanks!

@daxpedda
Copy link
Collaborator Author

Cc #1187.

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

Successfully merging this pull request may close these issues.

3 participants