Skip to content

Allow mutable return reference on signatures with any lifetime in argument #779

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

Merged
merged 2 commits into from
Mar 26, 2021

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Mar 26, 2021

Fixes #765.

@dtolnay dtolnay merged commit 5b97fc4 into master Mar 26, 2021
@dtolnay dtolnay deleted the mut branch March 26, 2021 22:05
@jaques-sam
Copy link

Hello, I don't really get why an argument needs to be provided in that case.
How do I define an extern C++ function call like this one?:

Logger &logger();

I tried this, but I still get this weird error:

     ┌─ src/main.rs:32:932fn logger<'static>() -> Pin<&'static mut Logger>;  // not working :'(
     │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ &mut return type is not allowed unless there is a &mut argument

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.

Allow mutable return reference on signatures with any lifetime in argument
2 participants