-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Tracking Issue for externally implementable items #125418
Comments
@jdonszelmann and I are currently implementing this, with a different syntax. Instead of using new syntax (e.g. #[externally_implementable(thing_handler)]
fn do_thing(); #[thing_handler]
fn my_thing_handler() {
..;
} This has a number of advantages. More updates soon! |
Does this introduce a new global namespace for |
Nope! It behaves the same as any other attribute (macro), as an item with a path. |
This comment has been minimized.
This comment has been minimized.
It would be nice to have a more-or-less complete list of externally-definable items that the stdlib would seek to provide. RFC 3632 mentions panic_handler and global_allocator, and implies that there are others that could use this, but I'm drawing a blank. |
The rng used by |
Why not...everything? Some use-cases I can come up with off the top of my head:
Give me a rust api, and I can come up with multiple situations for why I'd want to control it from user code. Almost all of them involve testing and observability, but there are real capability use-cases as well. IMO |
I intend to try to solve the libstd would somehow (tbd) define a "pre-main" hook that by default sets |
maybe a better approach would be to have an externally implemented item that handles |
The intent of not changing |
This is a tracking issue for the lang experiment on externally implementable items. This currently covers these proposals:
The feature gate for the issue is
#![feature(extern_item_impls)]
.About tracking issues
Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved Questions
Related
Implementation history
TODO.
cc @m-ou-se @Amanieu @tmandry @joshtriplett
The text was updated successfully, but these errors were encountered: