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
NativeCallContext
in export_module
results in a "hidden lifetime parameters in types are deprecated" warning
#864
Comments
Not sure about this because This is the first time I see this warning so I'll have to check it out... |
Seems like it is a flag I personally don't find it useful but that seems to be the case if that flag is turned on. |
Yes, sorry for not pointing that out. What's annoying is that it needs to be allowed at crate level, but if you do not want to bother with it I can simply allow the warning. Should this be kept open ? |
I personally prefer not to write up unnecessary lifetime parameters for code clarity. However it nows seems to go against recommendations.... Lets keep this open. I'll see later to make sure all generated code are good. Then user code can follow their own style. Maybe the docs should be updated to have all of those |
I'm not sure it's necessary ... when users write the type the compiler should warn them (if they have the lint enabled) so I don't think it is needed to update the docs everywhere. My only problem was with the export_plugin proc macro since if you write the elided lifetime the macro do not recognize the syntax. As I said in my first comment I guess a quick fix would be to have a variant with the elided lifetime that the macro can recognize. (along the one without the lifetime of course, so that users that do not use the lint are not impacted) |
Always put lifetimes in for generated code is ok. That's the best anyway. Not like anybody will read them... |
OK, I find out that Thanks! |
Passing a
NativeCallContext
in a function defined in a module exported via theexport_module
attribute generates the "hidden lifetime parameters in types are deprecated" warning.To reproduce:
Compiler diagnostic:
I guess that is because the macro does expect that
NativeCallContext
is declared as is, could it be possible to have a variant with the elided lifetime ?The text was updated successfully, but these errors were encountered: