-
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
Function pointer lifetimes #252
Conversation
I think no lifetime should behave just like an reference does. I imagine that there are few if any use cases that need the function pointer to escape. |
@cmr I checked and virtually every use of non- |
+1, this is the first step to enabling safe dynamic code loading. |
I think that alternative is the way to go. It doesn't commit us to adding more features today, but unlike the status quo and other proposals, it seems way more forwards compatible. C confuses arrays with pointers, and functions with function pointers. Rust fixed the former, it's high time it addressed the latter. |
@Ericson2314 The big issue with that though is that they are not and cannot be DSTs because they do not support dynamic queries of size and alignment. |
@eddyb Would adding length and alignment words before the code ptr work (i.e. [size, align, code....])? If not, won't there be some duplication either way as the RFC as written means a lot of borrowed pointer logic must be duplication? |
@Ericson2314 No, that would not work for, e.g |
This RFC has gotten quite old by now, and there are newer RFCs that offer more comprehensive solutions. I'm closing this RFC as postponed under #1037. Thanks very much for the suggestion! |
Implement `s.split()` for `Stream + Sink`
Browser Support Changes RFC
Rendered
(looks like I accidently removed the template by using the github quick commit, be careful)