-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rust-call
call ABI is not feature gated at call-sites
#34901
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
Comments
Conclusion: this seems like we ought to feature gate the call sites (but not a big deal ultimately). |
I want to fix this. The longer we leave holes like this open, the worst it will be when we fix it. triage: P-high. Assigning to self. |
The real danger would be if you could invoke rust-call things on stable. I think the main danger vector would be fn main() {
let x = || ();
Fn::call(&x, ());
} |
I'm confused as to why this is a problem. There's no stability hole here, since it's impossible to define functions with this ABI on stable. Just in the same way that it is possible to use a proc macro that uses If there are particular APIs we'd like to remain unstable to call directly (such as the |
(Not to say we shouldn't require a feature gate at call sites, I dont' have a problem with that) |
@nikomatsakis yeah, sorry, to clarify: I don't think it's wrong to feature-gate call sites, I just don't think it's a serious bug to not feature-gate call sites. |
We discussed this on Thursday's language team meeting. The conclusion was that if @pnkfelix wants to make a PR to fix this then @nikomatsakis would be happy to accept it. :) |
Note: This may be a feature, not a bug. But I wanted to make the point explicit.
If I make a crate named
defs
with this:and then a bin crate
uses
with a dependency ondefs
and this for itsmain.rs
:Compiling the former obviously provides the feature gate it needs to define something with the
rust-call
ABI.But compiling the latter does not require any feature gate, even though it is calling something via the
rust-call
ABI which is not stable.This may be fine, since the point of origin is gated (apart from problems like #34900). But it seems worth discussion.
The text was updated successfully, but these errors were encountered: