Skip to content

error on calls to ABIs that cannot be called #142597

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

folkertdev
Copy link
Contributor

We recently added extern "custom", which cannot be called using a rust call expression. But there are more ABIs that can't be called in that way, because the call does not semantically make sense.

More details are in #140566 (comment)

r? @workingjubilee

@rustbot
Copy link
Collaborator

rustbot commented Jun 16, 2025

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 16, 2025
@folkertdev folkertdev force-pushed the abi-cannot-be-called branch from 8a2bc53 to e88e066 Compare June 16, 2025 20:33
@folkertdev folkertdev force-pushed the abi-cannot-be-called branch 2 times, most recently from 03b0436 to 70c0e58 Compare June 17, 2025 17:46
Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would both like a slightly less annoying rebase, depending on which PR lands first (probably yours, tbh).

Comment on lines 97 to 106
extern "riscv-interrupt-s" fn riscv_s() {}
//[x64,x64_win,i686,arm,aarch64]~^ ERROR is not a supported ABI
fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) {
//[x64,x64_win,i686,arm,aarch64]~^ WARN unsupported_fn_ptr_calling_conventions
//[x64,x64_win,i686,arm,aarch64]~^^ WARN this was previously accepted
f()
//[riscv32,riscv64]~^ ERROR functions with the `"riscv-interrupt-s"` ABI cannot be called
}
extern "riscv-interrupt-s" {}
//[x64,x64_win,i686,arm,aarch64]~^ ERROR is not a supported ABI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sure is getting to be an exciting test file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the alternative is to split it up per-target, which has upsides and downsides.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the interest of minimizing (not eliminating, only minimizing) conflicts with a number of other in-flight PRs touching this file, can you duplicate (yes, duplicate as in add-a-new-file-with, not first-remove-here-and-then-add-a-new-file-with) the parts of the test for interrupt ABIs that you want to edit? then revert the change to this file that aren't going-to-happen-anyway?

include a FIXME that the duplication is intentional in the new file and that in the near future the duplication should be reduced (preferably by splitting up unsupported.rs a bit more but it really doesn't matter).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I split this out, and really there is less overlap than it seems: when using revisions, this is just kind of what you get. Any changes to the error messages will prompt to look at the duplication again.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 17, 2025
@folkertdev folkertdev force-pushed the abi-cannot-be-called branch 2 times, most recently from b09ca75 to 7ae8882 Compare June 18, 2025 09:34
@folkertdev folkertdev force-pushed the abi-cannot-be-called branch from 7ae8882 to 54970a8 Compare June 18, 2025 09:36
@folkertdev
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants