-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Reject unsupported extern "{abi}"
s consistently in all positions
#142134
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
workingjubilee
wants to merge
12
commits into
rust-lang:master
Choose a base branch
from
workingjubilee:reject-unsupported-abi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,288
−2,749
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5e8fa41
compiler: plug unsupported ABI leakage from the AST
workingjubilee 4c0bbe1
hir_analysis: Avoid repeating unsupported ABI errors
workingjubilee e641d36
compiler: Remove unsupported_fn_ptr_calling_conventions lint
workingjubilee 7843c4c
Clarify note in rustc_ast_lowering still applies
workingjubilee 857f149
unsupported_calling_conventions: print which ABI this is about
RalfJung 04d9939
tests: Bless abi_gpu_kernel feature gate test
workingjubilee 9dee929
tests: Enhance unsupported ABI tests
workingjubilee e212de7
tests: Update raw-dylib unsupported ABI test
workingjubilee c1092ff
tests: Update and bless cmse-nonsecure ABI tests
workingjubilee 4424563
tests: Adopt ABI transmute tests from crashtests
workingjubilee 882a136
tests: Verify varargs with unsupported fn ptr ABIs must error
workingjubilee b9e71b7
tests: Bless cannot-be-called and dedup with unsupported ABI test
workingjubilee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,75 @@ | ||
warning: the calling convention "msp430-interrupt" is not supported on this target | ||
--> $DIR/cannot-be-called.rs:60:18 | ||
error[E0570]: "msp430-interrupt" is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:38:8 | ||
| | ||
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> | ||
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default | ||
LL | extern "msp430-interrupt" fn msp430() {} | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: the calling convention "riscv-interrupt-m" is not supported on this target | ||
--> $DIR/cannot-be-called.rs:74:19 | ||
| | ||
LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:42:8 | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> | ||
LL | extern "riscv-interrupt-m" fn riscv_m() {} | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: the calling convention "riscv-interrupt-s" is not supported on this target | ||
--> $DIR/cannot-be-called.rs:81:19 | ||
| | ||
LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:44:8 | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> | ||
LL | extern "riscv-interrupt-s" fn riscv_s() {} | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: the calling convention "x86-interrupt" is not supported on this target | ||
--> $DIR/cannot-be-called.rs:88:15 | ||
error[E0570]: "x86-interrupt" is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:46:8 | ||
| | ||
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> | ||
LL | extern "x86-interrupt" fn x86() {} | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:36:1 | ||
error[E0570]: "msp430-interrupt" is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:65:25 | ||
| | ||
LL | extern "msp430-interrupt" fn msp430() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0570]: `"riscv-interrupt-m"` is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:40:1 | ||
error[E0570]: "riscv-interrupt-m" is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:77:26 | ||
| | ||
LL | extern "riscv-interrupt-m" fn riscv_m() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0570]: `"riscv-interrupt-s"` is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:42:1 | ||
error[E0570]: "riscv-interrupt-s" is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:83:26 | ||
| | ||
LL | extern "riscv-interrupt-s" fn riscv_s() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:44:1 | ||
error[E0570]: "x86-interrupt" is not a supported ABI for the current target | ||
--> $DIR/cannot-be-called.rs:89:22 | ||
| | ||
LL | extern "x86-interrupt" fn x86() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: functions with the "avr-interrupt" ABI cannot be called | ||
--> $DIR/cannot-be-called.rs:50:5 | ||
--> $DIR/cannot-be-called.rs:53:5 | ||
| | ||
LL | avr(); | ||
| ^^^^^ | ||
| | ||
note: an `extern "avr-interrupt"` function can only be called using inline assembly | ||
--> $DIR/cannot-be-called.rs:50:5 | ||
--> $DIR/cannot-be-called.rs:53:5 | ||
| | ||
LL | avr(); | ||
| ^^^^^ | ||
|
||
error: functions with the "avr-interrupt" ABI cannot be called | ||
--> $DIR/cannot-be-called.rs:70:5 | ||
--> $DIR/cannot-be-called.rs:73:5 | ||
| | ||
LL | f() | ||
| ^^^ | ||
| | ||
note: an `extern "avr-interrupt"` function can only be called using inline assembly | ||
--> $DIR/cannot-be-called.rs:70:5 | ||
--> $DIR/cannot-be-called.rs:73:5 | ||
| | ||
LL | f() | ||
| ^^^ | ||
|
||
error: aborting due to 6 previous errors; 4 warnings emitted | ||
error: aborting due to 10 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0570`. | ||
Future incompatibility report: Future breakage diagnostic: | ||
warning: the calling convention "msp430-interrupt" is not supported on this target | ||
--> $DIR/cannot-be-called.rs:60:18 | ||
| | ||
LL | fn msp430_ptr(f: extern "msp430-interrupt" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> | ||
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default | ||
|
||
Future breakage diagnostic: | ||
warning: the calling convention "riscv-interrupt-m" is not supported on this target | ||
--> $DIR/cannot-be-called.rs:74:19 | ||
| | ||
LL | fn riscv_m_ptr(f: extern "riscv-interrupt-m" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> | ||
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default | ||
|
||
Future breakage diagnostic: | ||
warning: the calling convention "riscv-interrupt-s" is not supported on this target | ||
--> $DIR/cannot-be-called.rs:81:19 | ||
| | ||
LL | fn riscv_s_ptr(f: extern "riscv-interrupt-s" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> | ||
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default | ||
|
||
Future breakage diagnostic: | ||
warning: the calling convention "x86-interrupt" is not supported on this target | ||
--> $DIR/cannot-be-called.rs:88:15 | ||
| | ||
LL | fn x86_ptr(f: extern "x86-interrupt" fn()) { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260> | ||
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.