Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
068a332
cfi: Remove #[no_sanitize(cfi)] for extern weak functions
1c3t3a Apr 11, 2025
8887af7
Improve parse errors for lifetimes in type position
fmease Apr 14, 2025
6242335
Improve diagnostic for E0178 (bad `+` in type)
fmease Apr 15, 2025
ee53c26
Add `explicit_extern_abis` unstable feature
obeis Apr 8, 2025
c4d3563
Also remove the no_sanitize feature for std
1c3t3a Apr 15, 2025
b084603
rustc_target: RISC-V: feature addition batch 2
a4lg Apr 6, 2025
52392ec
rustc_target: Use "B" shorthand on the RISC-V Android target
a4lg Apr 6, 2025
bd9bd38
Allow disabling `--llvm-shared` in opt-dist
Kobzol Apr 16, 2025
6f386e7
Only delete the lld directory if it exists
Kobzol Apr 16, 2025
48e119e
stepping into impls for norm is unproductive
lcnr Apr 16, 2025
face471
replace some #[rustc_intrinsic] usage with use of the libcore declara…
RalfJung Apr 16, 2025
7ce21e4
Cleaned up base tests for `isize` and `usize` in `tests/ui/numbers-ar…
spencer3035 Apr 16, 2025
01cfa9a
Add hard error for `extern` without explicit ABI
obeis Apr 8, 2025
d17c04e
Add test for `extern` without explicit ABI
obeis Apr 8, 2025
bb3c981
Don't require rigid alias's trait to hold
compiler-errors Apr 16, 2025
bb3e156
Rollup merge of #135340 - obeis:explicit-extern-abis, r=traviscross,n…
matthiaskrgr Apr 16, 2025
ff55f2a
Rollup merge of #139440 - a4lg:riscv-feature-addition-batch-2, r=Amanieu
matthiaskrgr Apr 16, 2025
f14e632
Rollup merge of #139667 - 1c3t3a:remove-no-sanitize, r=m-ou-se
matthiaskrgr Apr 16, 2025
c594a88
Rollup merge of #139828 - compiler-errors:rigid-trait, r=lcnr
matthiaskrgr Apr 16, 2025
7ab385e
Rollup merge of #139854 - fmease:modern-diag-for-lt-in-ty, r=davidtwco
matthiaskrgr Apr 16, 2025
afb60d3
Rollup merge of #139889 - spencer3035:clean-ui-tests-3-of-n, r=jieyouxu
matthiaskrgr Apr 16, 2025
848ec58
Rollup merge of #139894 - Kobzol:opt-dist-fixes, r=lqd
matthiaskrgr Apr 16, 2025
9e0be6c
Rollup merge of #139900 - lcnr:normalizes-to-where-bounds-unproductiv…
matthiaskrgr Apr 16, 2025
f8f22ad
Rollup merge of #139915 - RalfJung:intrinsic-imports, r=compiler-errors
matthiaskrgr Apr 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add explicit_extern_abis unstable feature
also add `explicit-extern-abis` feature section to
the unstable book.
  • Loading branch information
obeis committed Apr 15, 2025
commit ee53c26b41a74eb0ecf785e8cfac98e5aa980756
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ declare_features! (
(incomplete, ergonomic_clones, "1.87.0", Some(132290)),
/// Allows exhaustive pattern matching on types that contain uninhabited types.
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
/// Disallows `extern` without an explicit ABI.
(unstable, explicit_extern_abis, "CURRENT_RUSTC_VERSION", Some(134986)),
/// Allows explicit tail calls via `become` expression.
(incomplete, explicit_tail_calls, "1.72.0", Some(112788)),
/// Allows using `aapcs`, `efiapi`, `sysv64` and `win64` as calling conventions
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@ symbols! {
expf16,
expf32,
expf64,
explicit_extern_abis,
explicit_generic_args_with_impl_trait,
explicit_tail_calls,
export_name,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# `explicit_extern_abis`

The tracking issue for this feature is: #134986

------

Disallow `extern` without an explicit ABI. We should write `extern "C"`
(or another ABI) instead of just `extern`.

By making the ABI explicit, it becomes much clearer that "C" is just one of the
possible choices, rather than the "standard" way for external functions.
Removing the default makes it easier to add a new ABI on equal footing as "C".

```rust,editionfuture,compile_fail
#![feature(explicit_extern_abis)]

extern fn function1() {} // ERROR `extern` declarations without an explicit ABI
// are disallowed

extern "C" fn function2() {} // compiles

extern "aapcs" fn function3() {} // compiles
```