-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improve the fn
pointer types
#1037
Comments
fn
pointer types
I am currently of the opinion that if function pointers are not considered pointers by the language, then we'd better call them something else, like "function handles". This can be the first step towards improving "Function pointers are not considered pointers" feels like a flaw in Rust's design, but "function handles are not considered pointers" doesn't. Also, if later "true" function pointers are introduced, we need to disamiguate I wonder if such a renaming proposal should be an RFC? :) |
We still need a way to specify lifetimes for However, when it comes to DLL loading (see #661), lifetimes of functions that are being used outside of the loaded code will be bound by the lifetime of the library (handle) itself, which the loaded code is unaware of. In this sense, 'static' in all the library code refers to the lifetime of the libray. This means that when symbols are resolved from a DLL, a Additionally, there should be some similar way to specify lifetimes for |
The current function pointer types have some downsides:
This is a "postponement issue". There have been various RFCs aiming to improve this:
fn
types.fn
to&'static fn
for forwards compatibility.It should be possible to adapt these schemes backwards compatibly.
The text was updated successfully, but these errors were encountered: