-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add (back) unsupported_calling_conventions
lint to reject more invalid calling conventions
#141435
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
base: master
Are you sure you want to change the base?
Add (back) unsupported_calling_conventions
lint to reject more invalid calling conventions
#141435
Conversation
…d calling conventions
These commits modify compiler targets. |
3251270
to
f4146aa
Compare
also unify error messages that do not seem to have a good reason to be different
f4146aa
to
b8f4367
Compare
@rust-lang/lang following positive vibes expressed here, I'd like to land this PR as a first step to implement the plan from that issue. Can we get this FCPd? :) The one potential open question here is whether this should be a regular FCW first or whether it can immediately become an FCW that shows up in dependencies. I assume stdcall and fastcall are sufficiently rare that we can go for report-in-deps immediately (since they already get rejected on non-x86-32 non-Windows targets). "cdecl" might be more widely used though so it may be worth ramping up the lint more slowly. |
Searching across GitHub, there are 506 Rust file hits on Regarding whether to fire the FCW in deps immediately, I lean toward it probably being OK. Given that this may show up in |
Oh that's the syntax for doing such a search... I tried and failed to get a similar result out of github search.^^ |
unsupported_calling_conventions
lint to reject more invalid calling conventions
Let's propose to do it. @rfcbot fcp merge |
Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
@rfcbot reviewed |
@rfcbot reviewed I think, in the case of
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Noting using such searches as TC mentioned:
...and many of these hits are just on our own repo but forked. |
Somewhat unscientifically skimming the searches, I notice:
So I agree that we should probably offer suggestions for migrating |
b73f7b4
to
cf20f7b
Compare
I added targeted help messages for "stdcall" and "cdecl". I made them also show up for the hard error since they should be helpful there too, e.g. when someone tries to use "stdcall" on x86_64-Linux. |
cf20f7b
to
0d3a7bb
Compare
r? @workingjubilee maybe, feel free to reassign |
This adds back the
unsupported_calling_conventions
lint that was removed in #129935, in order to start the process of dealing with #137018. Specifically, we are going for the plan laid out here:The difference to the status quo is that:
Vectorcall is an unstable ABI so we can just make this a hard error immediately. The others are stable, so we emit the
unsupported_calling_conventions
forward-compat lint. I set up the lint to show up in dependencies via cargo's future-compat report immediately, but we could also make it show up just for the local crate first if that is preferred.