-
Notifications
You must be signed in to change notification settings - Fork 43
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
Compile error if exported host functions overlap #189
Comments
I don't love this idea, but a hack way to prevent this might be to write out some constants for each module and link name, since the compiler will error if there are constants with the same name. The error would not be particularly pretty, but any error is better than no error. |
Setting target milestone to |
since we use a proc macro now this is actually fairly trivial -- just check all the names when we read in the json file. |
@jonjove reported in Discord (ref) that we had some extern host fns overlapping which he fixed in #185.
I double checked and tried changing functions to use the same link names and the Rust compiler doesn't error at all.
This seems like quite a footgun. Of course if this happens with functions that behave wildly differently we're likely to notice. But for functions that behave somewhat similarly this could go unnoticed but have an enormous impact.
The host functions are generated by some macro rules in the common crate. We should find some way to ensure that their names are all unique.
cc @jayz22 @graydon @jonjove
The text was updated successfully, but these errors were encountered: