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

@folkertdev folkertdev commented Jun 16, 2025

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

try-job: x86_64-gnu-llvm-19-3

@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 3 times, most recently 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
@workingjubilee
Copy link
Member

@bors r+

Only affects unstable API
@bors rollup

@bors
Copy link
Collaborator

bors commented Jun 20, 2025

📌 Commit 54970a8 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2025
tgross35 added a commit to tgross35/rust that referenced this pull request Jun 20, 2025
…=workingjubilee

error on calls to ABIs that cannot be called

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 rust-lang#140566 (comment)

r? `@workingjubilee`
bors added a commit that referenced this pull request Jun 20, 2025
Rollup of 8 pull requests

Successful merges:

 - #138291 (rewrite `optimize` attribute to use new attribute parsing infrastructure)
 - #140920 (Extract some shared code from codegen backend target feature handling)
 - #141990 (Implement send_signal for unix child processes)
 - #142597 (error on calls to ABIs that cannot be called)
 - #142668 (vec_deque/fmt/vec tests: remove static mut)
 - #142687 (Reduce uses of `hir_crate`.)
 - #142699 (Update books)
 - #142714 (add comment to `src/bootstrap/build.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
@tgross35
Copy link
Contributor

Well, this is doing its job #142762 (comment)

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 20, 2025
@folkertdev
Copy link
Contributor Author

A casualty of CI now running on aarch64. This test could just use minicore though I think? I'll fix that later today.

https://github.com/rust-lang/rust/blob/master/tests/codegen/naked-asan.rs

@tgross35
Copy link
Contributor

@bors2 delegate=try

@rust-bors
Copy link

rust-bors bot commented Jun 20, 2025

@folkertdev can now perform try builds on this pull request

@folkertdev folkertdev force-pushed the abi-cannot-be-called branch from 54970a8 to a32d085 Compare June 20, 2025 17:09
@folkertdev
Copy link
Contributor Author

@bors2 try=x86_64-gnu-llvm-19-3

@rust-bors
Copy link

rust-bors bot commented Jun 20, 2025

Unknown command "try".

@folkertdev
Copy link
Contributor Author

@bors2 try

rust-bors bot added a commit that referenced this pull request Jun 20, 2025
error on calls to ABIs that cannot be called

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`

try-job: x86_64-gnu-llvm-19-3
@rust-bors
Copy link

rust-bors bot commented Jun 20, 2025

⌛ Trying commit a32d085 with merge 8c73581

To cancel the try build, run the command @bors2 try cancel.

@tgross35
Copy link
Contributor

@bors2 try=x86_64-gnu-llvm-19-3

For reference it’s bors2 try jobs=…

@rust-bors
Copy link

rust-bors bot commented Jun 20, 2025

☀️ Try build successful (CI)
Build commit: 8c73581 (8c73581ec29d2c5dd590ad546ef66e0434b83c33, parent: 9c4ff566babe632af5e30281a822d1ae9972873b)

@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 20, 2025
@tgross35
Copy link
Contributor

@bors r=workingjubilee rollup=maybe

@bors
Copy link
Collaborator

bors commented Jun 20, 2025

📌 Commit a32d085 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants