Future incompatibility warning unsupported_fn_ptr_calling_conventions: Also warn in dependencies by tdittr · Pull Request #135767 · rust-lang/rust (original) (raw)
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
compiler-errors added T-lang
Relevant to the language team
DEPRECATED: Use the team-based variants `S-waiting-on-t-lang`, `S-waiting-on-t-compiler`, ...
and removed T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Status: Awaiting review from the assignee but also interested parties.
labels
jieyouxu added the S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
label
This was left to only warn in the current crate to give users a chance to update their code. Now for 1.86 we also warn users depending on those crates.
Otherwise this test will include a future incompatibility warning on some targets but not others.
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
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
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 12 pull requests
Successful merges:
- rust-lang#135767 (Future incompatibility warning
unsupported_fn_ptr_calling_conventions: Also warn in dependencies) - rust-lang#137852 (Remove layouting dead code for non-array SIMD types.)
- rust-lang#137863 (Fix pretty printing of unsafe binders)
- rust-lang#137882 (do not build additional stage on compiler paths)
- rust-lang#137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset")
- rust-lang#137902 (Make
ast::TokenKindmore likelexer::TokenKind) - rust-lang#137921 (Subtree update of
rust-analyzer) - rust-lang#137922 (A few cleanups after the removal of
cfg(not(parallel))) - rust-lang#137939 (fix order on shl impl)
- rust-lang#137946 (Fix docker run-local docs)
- rust-lang#137955 (Always allow rustdoc-json tests to contain long lines)
- rust-lang#137958 (triagebot.toml: Don't label
test/rustdoc-jsonas A-rustdoc-search)
r? @ghost
@rustbot modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#135767 - tdittr:fn_ptr_calling_conventions-in-deps, r=compiler-errors
Future incompatibility warning unsupported_fn_ptr_calling_conventions: Also warn in dependencies
Tracking issue: rust-lang#130260
As discussed in the previous PR now the future incompatibility warning is enabled in dependencies.
The warning was added in 1.83, while this change will get into stable in 1.86, which gives crate authors three versions to fix the warning.
r? compiler-errors
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request
…iaskrgr
Rollup of 12 pull requests
Successful merges:
- rust-lang#135767 (Future incompatibility warning
unsupported_fn_ptr_calling_conventions: Also warn in dependencies) - rust-lang#137852 (Remove layouting dead code for non-array SIMD types.)
- rust-lang#137863 (Fix pretty printing of unsafe binders)
- rust-lang#137882 (do not build additional stage on compiler paths)
- rust-lang#137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset")
- rust-lang#137902 (Make
ast::TokenKindmore likelexer::TokenKind) - rust-lang#137921 (Subtree update of
rust-analyzer) - rust-lang#137922 (A few cleanups after the removal of
cfg(not(parallel))) - rust-lang#137939 (fix order on shl impl)
- rust-lang#137946 (Fix docker run-local docs)
- rust-lang#137955 (Always allow rustdoc-json tests to contain long lines)
- rust-lang#137958 (triagebot.toml: Don't label
test/rustdoc-jsonas A-rustdoc-search)
r? @ghost
@rustbot modify labels: rollup
flip1995 pushed a commit to flip1995/rust that referenced this pull request
…iaskrgr
Rollup of 12 pull requests
Successful merges:
- rust-lang#135767 (Future incompatibility warning
unsupported_fn_ptr_calling_conventions: Also warn in dependencies) - rust-lang#137852 (Remove layouting dead code for non-array SIMD types.)
- rust-lang#137863 (Fix pretty printing of unsafe binders)
- rust-lang#137882 (do not build additional stage on compiler paths)
- rust-lang#137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset")
- rust-lang#137902 (Make
ast::TokenKindmore likelexer::TokenKind) - rust-lang#137921 (Subtree update of
rust-analyzer) - rust-lang#137922 (A few cleanups after the removal of
cfg(not(parallel))) - rust-lang#137939 (fix order on shl impl)
- rust-lang#137946 (Fix docker run-local docs)
- rust-lang#137955 (Always allow rustdoc-json tests to contain long lines)
- rust-lang#137958 (triagebot.toml: Don't label
test/rustdoc-jsonas A-rustdoc-search)
r? @ghost
@rustbot modify labels: rollup
GuillaumeGomez pushed a commit to GuillaumeGomez/rust that referenced this pull request
…iaskrgr
Rollup of 12 pull requests
Successful merges:
- rust-lang#135767 (Future incompatibility warning
unsupported_fn_ptr_calling_conventions: Also warn in dependencies) - rust-lang#137852 (Remove layouting dead code for non-array SIMD types.)
- rust-lang#137863 (Fix pretty printing of unsafe binders)
- rust-lang#137882 (do not build additional stage on compiler paths)
- rust-lang#137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset")
- rust-lang#137902 (Make
ast::TokenKindmore likelexer::TokenKind) - rust-lang#137921 (Subtree update of
rust-analyzer) - rust-lang#137922 (A few cleanups after the removal of
cfg(not(parallel))) - rust-lang#137939 (fix order on shl impl)
- rust-lang#137946 (Fix docker run-local docs)
- rust-lang#137955 (Always allow rustdoc-json tests to contain long lines)
- rust-lang#137958 (triagebot.toml: Don't label
test/rustdoc-jsonas A-rustdoc-search)
r? @ghost
@rustbot modify labels: rollup
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request
This MR contains the following updates:
| Package | Update | Change |
|---|---|---|
| rust | minor | 1.86.0 -> 1.87.0 |
MR created with the help of el-capitano/tools/renovate-bot.
Proposed changes to behavior should be submitted there as MRs.
Release Notes
rust-lang/rust (rust)
v1.87.0
==========================
Language
- Stabilize
asm_gotofeature - Allow parsing open beginning ranges (
..EXPR) after unary operators!,-, and*. - Don't require method impls for methods with
Self: Sizedbounds inimpls for unsized types - Stabilize
feature(precise_capturing_in_traits)allowinguse<...>bounds on return positionimpl Traitintraits
Compiler
Platform Support
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Stabilize the anonymous pipe API
- Add support for unbounded left/right shift operations
- Print pointer metadata in
Debugimpl of raw pointers Vec::with_capacityguarantees it allocates with the amount requested, even ifVec::capacityreturns a different number.- Most
std::archintrinsics which don't take pointer arguments can now be called from safe code if the caller has the appropriate target features already enabled (rust-lang/stdarch#1714, rust-lang/stdarch#1716, rust-lang/stdarch#1717) - Undeprecate
env::home_dir - Denote
ControlFlowas#[must_use] - Macros such as
assert_eq!andvec!now supportconst {...}expressions
Stabilized APIs
Vec::extract_ifvec::ExtractIfLinkedList::extract_iflinked_list::ExtractIf<[T]>::split_off<[T]>::split_off_mut<[T]>::split_off_first<[T]>::split_off_first_mut<[T]>::split_off_last<[T]>::split_off_last_mutString::extend_from_withinos_str::DisplayOsString::displayOsStr::displayio::pipeio::PipeReaderio::PipeWriterimpl From<PipeReader> for OwnedHandleimpl From<PipeWriter> for OwnedHandleimpl From<PipeReader> for Stdioimpl From<PipeWriter> for Stdioimpl From<PipeReader> for OwnedFdimpl From<PipeWriter> for OwnedFdBox<MaybeUninit<T>>::writeimpl TryFrom<Vec<u8>> for String<*const T>::offset_from_unsigned<*const T>::byte_offset_from_unsigned<*mut T>::offset_from_unsigned<*mut T>::byte_offset_from_unsignedNonNull::offset_from_unsignedNonNull::byte_offset_from_unsigned<uN>::cast_signedNonZero::<uN>::cast_signed.<iN>::cast_unsigned.NonZero::<iN>::cast_unsigned.<uN>::is_multiple_of<uN>::unbounded_shl<uN>::unbounded_shr<iN>::unbounded_shl<iN>::unbounded_shr<iN>::midpoint<str>::from_utf8<str>::from_utf8_mut<str>::from_utf8_unchecked<str>::from_utf8_unchecked_mut
These previously stable APIs are now stable in const contexts:
core::str::from_utf8_mut<[T]>::copy_from_sliceSocketAddr::set_ipSocketAddr::set_port,SocketAddrV4::set_ipSocketAddrV4::set_port,SocketAddrV6::set_ipSocketAddrV6::set_portSocketAddrV6::set_flowinfoSocketAddrV6::set_scope_idchar::is_digitchar::is_whitespace<[[T; N]]>::as_flattened<[[T; N]]>::as_flattened_mutString::into_bytesString::as_strString::capacityString::as_bytesString::lenString::is_emptyString::as_mut_strString::as_mut_vecVec::as_ptrVec::as_sliceVec::capacityVec::lenVec::is_emptyVec::as_mut_sliceVec::as_mut_ptr
Cargo
- Add terminal integration via ANSI OSC 9;4 sequences
- chore: bump openssl to v3
- feat(package): add --exclude-lockfile flag
Compatibility Notes
- Rust now raises an error for macro invocations inside the
#![crate_name]attribute - Unstable fields are now always considered to be inhabited
- Macro arguments of unary operators followed by open beginning ranges may now be matched differently
- Make
Debugimpl of raw pointers print metadata if present - Warn against function pointers using unsupported ABI strings in dependencies
- Associated types on
dyntypes are no longer deduplicated - Forbid attributes on
..inside of struct patterns (let Struct { #[attribute] .. }) = - Make
ptr_cast_add_auto_to_objectlint into hard error - Many
std::archintrinsics are now safe to call in some contexts, there may now be newunused_unsafewarnings in existing codebases. - Limit
widthandprecisionformatting options to 16 bits on all targets - Turn order dependent trait objects future incompat warning into a hard error
- Denote
ControlFlowas#[must_use] - Windows: The standard library no longer links
advapi32, except on win7. Code such as C libraries that were relying on this assumption may need to explicitly link advapi32. - Proc macros can no longer observe expanded
cfg(true)attributes. - Start changing the internal representation of pasted tokens. Certain invalid declarative macros that were previously accepted in obscure circumstances are now correctly rejected by the compiler. Use of a
ttfragment specifier can often fix these macros. - Don't allow flattened format_args in const.
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this MR and you won't be reminded about this update again.
- If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request
Pkgsrc changes:
- patches adjustments to adapt to upstream changes & new versions of included crates
- associated checksums++
Upstream changes relative to 1.86.0:
Version 1.87.0 (2025-05-15)
Language
- [Stabilize
asm_gotofeature] (rust-lang/rust#133870) - [Allow parsing open beginning ranges (
..EXPR) after unary operators!,~,-, and*}] (rust-lang/rust#134900). - [Don't require method impls for methods with
Self: Sizedbounds inimpls for unsized types] (rust-lang/rust#135480) - [Stabilize
feature(precise_capturing_in_traits)allowinguse<...>bounds on return positionimpl Traitintraits] (rust-lang/rust#138128)
Compiler
- [x86: make SSE2 required for i686 targets and use it to pass SIMD types] (rust-lang/rust#135408)
Platform Support
- [Remove
i586-pc-windows-msvctarget] (rust-lang/rust#137957)
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- [Stabilize the anonymous pipe API] (rust-lang/rust#127154)
- [Add support for unbounded left/right shift operations] (rust-lang/rust#129375)
- [Print pointer metadata in
Debugimpl of raw pointers] (rust-lang/rust#135080) - [
Vec::with_capacityguarantees it allocates with the amount requested, even ifVec::capacityreturns a different number.] (rust-lang/rust#135933) - Most
std::archintrinsics which don't take pointer arguments can now be called from safe code if the caller has the appropriate target features already enabled (rust-lang/stdarch#1714, rust-lang/stdarch#1716, rust-lang/stdarch#1717) - [Undeprecate
env::home_dir] (rust-lang/rust#137327) - [Denote
ControlFlowas#[must_use]] (rust-lang/rust#137449) - [Macros such as
assert_eq!andvec!now supportconst {...}expressions] (rust-lang/rust#138162)
Stabilized APIs
- [
Vec::extract_if] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.extract_if) - [
vec::ExtractIf] (https://doc.rust-lang.org/stable/std/vec/struct.ExtractIf.html) - [
LinkedList::extract_if] (https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.extract_if) - [
linked_list::ExtractIf] (https://doc.rust-lang.org/stable/std/collections/linked_list/struct.ExtractIf.html) - [
<[T]>::split_off] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off) - [
<[T]>::split_off_mut] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_mut) - [
<[T]>::split_off_first] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_first) - [
<[T]>::split_off_first_mut] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_first_mut) - [
<[T]>::split_off_last] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_last) - [
<[T]>::split_off_last_mut] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_off_last_mut) - [
String::extend_from_within] (https://doc.rust-lang.org/stable/alloc/string/struct.String.html#method.extend_from_within) - [
os_str::Display] (https://doc.rust-lang.org/stable/std/ffi/os_str/struct.Display.html) - [
OsString::display] (https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.display) - [
OsStr::display] (https://doc.rust-lang.org/stable/std/ffi/struct.OsStr.html#method.display) - [
io::pipe] (https://doc.rust-lang.org/stable/std/io/fn.pipe.html) - [
io::PipeReader] (https://doc.rust-lang.org/stable/std/io/struct.PipeReader.html) - [
io::PipeWriter] (https://doc.rust-lang.org/stable/std/io/struct.PipeWriter.html) - [
impl From<PipeReader> for OwnedHandle] (https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeReader%3E-for-OwnedHandle) - [
impl From<PipeWriter> for OwnedHandle] (https://doc.rust-lang.org/stable/std/os/windows/io/struct.OwnedHandle.html#impl-From%3CPipeWriter%3E-for-OwnedHandle) - [
impl From<PipeReader> for Stdio] (https://doc.rust-lang.org/stable/std/process/struct.Stdio.html) - [
impl From<PipeWriter> for Stdio] (https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CPipeWriter%3E-for-Stdio) - [
impl From<PipeReader> for OwnedFd] (https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeReader%3E-for-OwnedFd) - [
impl From<PipeWriter> for OwnedFd] (https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html#impl-From%3CPipeWriter%3E-for-OwnedFd) - [
Box<MaybeUninit<T>>::write] (https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.write) - [
impl TryFrom<Vec<u8>> for String] (https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-TryFrom%3CVec%3Cu8%3E%3E-for-String) - [
<*const T>::offset_from_unsigned] (https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from_unsigned) - [
<*const T>::byte_offset_from_unsigned] (https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.byte_offset_from_unsigned) - [
<*mut T>::offset_from_unsigned] (https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from_unsigned-1) - [
<*mut T>::byte_offset_from_unsigned] (https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.byte_offset_from_unsigned-1) - [
NonNull::offset_from_unsigned] (https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.offset_from_unsigned) - [
NonNull::byte_offset_from_unsigned] (https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.byte_offset_from_unsigned) - [
<uN>::cast_signed] (https://doc.rust-lang.org/stable/std/primitive.usize.html#method.cast_signed) - [
NonZero::<uN>::cast_signed] (https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.cast_signed-5). - [
<iN>::cast_unsigned] (https://doc.rust-lang.org/stable/std/primitive.isize.html#method.cast_unsigned). - [
NonZero::<iN>::cast_unsigned] (https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.cast_unsigned-5). - [
<uN>::is_multiple_of] (https://doc.rust-lang.org/stable/std/primitive.usize.html#method.is_multiple_of) - [
<uN>::unbounded_shl] (https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unbounded_shl) - [
<uN>::unbounded_shr] (https://doc.rust-lang.org/stable/std/primitive.usize.html#method.unbounded_shr) - [
<iN>::unbounded_shl] (https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unbounded_shl) - [
<iN>::unbounded_shr] (https://doc.rust-lang.org/stable/std/primitive.isize.html#method.unbounded_shr) - [
<iN>::midpoint] (https://doc.rust-lang.org/stable/std/primitive.isize.html#method.midpoint) - [
<str>::from_utf8] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8) - [
<str>::from_utf8_mut] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8_mut) - [
<str>::from_utf8_unchecked] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8_unchecked) - [
<str>::from_utf8_unchecked_mut] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.from_utf8_unchecked_mut)
These previously stable APIs are now stable in const contexts:
- [
core::str::from_utf8_mut] (https://doc.rust-lang.org/stable/std/str/fn.from_utf8_mut.html) - [
<[T]>::copy_from_slice] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.copy_from_slice) - [
SocketAddr::set_ip] (https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.set_ip) - [
SocketAddr::set_port] (https://doc.rust-lang.org/stable/std/net/enum.SocketAddr.html#method.set_port), - [
SocketAddrV4::set_ip] (https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.set_ip) - [
SocketAddrV4::set_port] (https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV4.html#method.set_port), - [
SocketAddrV6::set_ip] (https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_ip) - [
SocketAddrV6::set_port] (https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_port) - [
SocketAddrV6::set_flowinfo] (https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_flowinfo) - [
SocketAddrV6::set_scope_id] (https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.set_scope_id) - [
char::is_digit] (https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_digit) - [
char::is_whitespace] (https://doc.rust-lang.org/stable/std/primitive.char.html#method.is_whitespace) - [
<[[T; N]]>::as_flattened] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_flattened) - [
<[[T; N]]>::as_flattened_mut] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_flattened_mut) - [
String::into_bytes] (https://doc.rust-lang.org/stable/std/string/struct.String.html#method.into_bytes) - [
String::as_str] (https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_str) - [
String::capacity] (https://doc.rust-lang.org/stable/std/string/struct.String.html#method.capacity) - [
String::as_bytes] (https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_bytes) - [
String::len] (https://doc.rust-lang.org/stable/std/string/struct.String.html#method.len) - [
String::is_empty] (https://doc.rust-lang.org/stable/std/string/struct.String.html#method.is_empty) - [
String::as_mut_str] (https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_mut_str) - [
String::as_mut_vec] (https://doc.rust-lang.org/stable/std/string/struct.String.html#method.as_mut_vec) - [
Vec::as_ptr] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_ptr) - [
Vec::as_slice] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_slice) - [
Vec::capacity] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.capacity) - [
Vec::len] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.len) - [
Vec::is_empty] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.is_empty) - [
Vec::as_mut_slice] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_mut_slice) - [
Vec::as_mut_ptr] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.as_mut_ptr)
Cargo
- [Add terminal integration via ANSI OSC 9;4 sequences] (rust-lang/cargo#14615)
- [chore: bump openssl to v3] (rust-lang/cargo#15232)
- [feat(package): add --exclude-lockfile flag] (rust-lang/cargo#15234)
Compatibility Notes
- [Rust now raises an error for macro invocations inside the
#![crate_name]attribute] (rust-lang/rust#127581) - [Unstable fields are now always considered to be inhabited] (rust-lang/rust#133889)
- [Macro arguments of unary operators followed by open beginning ranges may now be matched differently] (rust-lang/rust#134900)
- [Make
Debugimpl of raw pointers print metadata if present] (rust-lang/rust#135080) - [Warn against function pointers using unsupported ABI strings in dependencies] (rust-lang/rust#135767)
- [Associated types on
dyntypes are no longer deduplicated] (rust-lang/rust#136458) - [Forbid attributes on
..inside of struct patterns (let Struct { #[attribute] .. }) =] (rust-lang/rust#136490) - [Make
ptr_cast_add_auto_to_objectlint into hard error] (rust-lang/rust#136764) - Many
std::archintrinsics are now safe to call in some contexts, there may now be newunused_unsafewarnings in existing codebases. - [Limit
widthandprecisionformatting options to 16 bits on all targets] (rust-lang/rust#136932) - [Turn order dependent trait objects future incompat warning into a hard error] (rust-lang/rust#136968)
- [Denote
ControlFlowas#[must_use]] (rust-lang/rust#137449) - [Windows: The standard library no longer links
advapi32, except on win7.] (rust-lang/rust#138233) Code such as C libraries that were relying on this assumption may need to explicitly link advapi32. - Proc macros can no longer observe expanded
cfg (true)attributes. - [Start changing the internal representation of pasted tokens]
(rust-lang/rust#124141). Certain invalid
declarative macros that were previously accepted in obscure
circumstances are now correctly rejected by the compiler. Use of
a
ttfragment specifier can often fix these macros. - [Don't allow flattened format_args in const.] (rust-lang/rust#139624)
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
- [Update to LLVM 20] (rust-lang/rust#135763)
rust-bors bot added a commit that referenced this pull request
Reject extern "{abi}" when the target does not support it
What
Promote unsupported_fn_ptr_calling_conventions from a warning to a hard error, making sure edge-cases will not escape. We now emit hard errors for every case we would return Invalid from AbiMap::canonize_abi during AST to HIR lowering. In particular, these architecture-specific ABIs now only compile on their architectures[^1]:
- amdgpu: "gpu-kernel"
- arm: "aapcs", "C-cmse-nonsecure-entry"
- avr: "avr-interrupt", "avr-non-blocking-interrupt"
- msp430: "msp430-interrupt"
- nvptx64: "gpu-kernel", "ptx-kernel"
- riscv32 and riscv64: "riscv-interrupt-machine", "riscv-interrupt-supervisor"
- x86: "thiscall"
- x86 and x86_64: "x86-interrupt"
- x86_64: "sysv64", "win64"
The panoply of ABIs that are logically x86-specific but actually permitted on all Windows targets remain supported on Windows, as they were before. For non-Windows targets they error if the architecture does not match.
Moving the check into AST lowering is itself a breaking change in rare cases, above and beyond the cases rustc currently warns about. See "Why or Why Not" for details.
How
We modify rustc_ast_lowering to prevent unsupported ABIs from leaking through the HIR without being checked for target support. Previously ad-hoc checking on various HIR items required making sure we check every HIR item which could contain an extern "{abi}" string. This is a losing proposition compared to gating the lowering itself.
As a consequence, unsupported ABI strings will now hard-error instead of triggering the FCW unsupported_fn_ptr_calling_conventions.
However, per #86232 this does cause errors for rare usages of extern "{abi}" that were theoretically possible to write in Rust source, without previous warning or error. For instance, trait declarations without impls were never checked. These are the exact kinds of leakages that this new approach prevents.
This differs from the following PRs:
- #141435 is orthogonal, as it adds a new lint for ABIs we have not warned on and are not touched by this PR
- #141877 is subsumed by this, in that this simply cuts out bad functionality instead of adding epicycles for stable code
Why or Why Not
We already made the decision to issue the unsupported_fn_ptr_calling_conventions future compatibility warning. It has warned in dependencies since #135767, which reached stable with Rust 1.87. That was released on 2025 May 17, and it is now June. As we already had erred on these ABI strings in most other positions, and warn on stable for function pointer types, this breakage has had reasonable foreshadowing.
Upgrading the warning to an error addresses a real problem. In some cases the Rust compiler can attempt to actually compute the ABI for calling a function. We could accept this case and compute unsupported ABIs according to some other ABI, silently[^0]. However, this obviously exposes Rust to errors in codegen. We cannot lower directly to the "obvious" ABI and then trust code generators like LLVM to reliably error on these cases, either.
Refactoring the compiler so we could defer more ABI computations would be possible, but seems weakly motivated. Even if we succeeded, we would at minimum risk:
- exposing the "whack-a-mole" problem but "approaching linking" instead of "leaving AST"
- making it harder to reason about functions we can lower further
- complicating the compiler for no clear benefit
A deprecation cycle for the edge-cases could be implemented first, but it is not very useful for such marginal cases, like this trait declaration without a definition:
pub trait UsedToSneakBy {
pub extern "gpu-kernel" fn sneaky();
}Upon any impl, even for provided fn within trait declarations, e.g. pub extern "gpu-kernel" fn sneaky() {}, different HIR types were used which would, in fact, get checked. Likewise with anything with function pointers. Thus we would be discussing deprecation cycles for code that is impotent or forewarned[^2].
Implementing a deprecation cycle is possible, but it would likely require emitting multiple of a functionally identical warning or error on code that would not have multiple warnings or errors before. It is also not clear to me we would not find another, even more marginal edge-case that slipped through, as "things slip through" is the motivation for checking earlier. Additional effort spent on additional warnings should require committing to a hard limit first.
r? lang
Fixes #86232 Fixes #132430 Fixes #138738 Fixes #142107
[^1]: Some already will not compile, due to reaching ICEs or LLVM errors.
[^0]: We already do this for all AbiStr we cannot parse, pretending they are ExternAbi::Rust, but we also emit an error to prevent reaching too far into codegen.
[^2]: It actually did appear in two cases in rustc's test suite because we are a collection of Rust edge-cases by the simple fact that we don't care if the code actually runs. These cases were excised in c1db989.
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request
…abi, r=jdonszelmann,RalfJung
Reject unsupported extern "{abi}"s consistently in all positions
Modify the handling of extern "{abi}" in the compiler so that it has consistent errors without regard to the position in the grammar.
What
Implement the following breakages:
- Promote
unsupported_fn_ptr_calling_conventionsfrom a warning to a hard error - Guarantee future edge-cases like trait declarations will not escape so that ABIs that have already been unusable in most positions will now be unusable in all positions. See "How" and "Why or Why Not" for more details.
In particular, these architecture-specific ABIs now only compile on their architectures[^4]:
- amdgpu: "gpu-kernel"
- arm: "aapcs", "C-cmse-nonsecure-entry", "C-cmse-nonsecure-call"
- avr: "avr-interrupt", "avr-non-blocking-interrupt"
- msp430: "msp430-interrupt"
- nvptx64: "gpu-kernel", "ptx-kernel"
- riscv32 and riscv64: "riscv-interrupt-m", "riscv-interrupt-s"
- x86: "thiscall"
- x86 and x86_64: "x86-interrupt"
- x86_64: "sysv64", "win64"
ABIs that are logically x86-specific but actually permitted on all Windows targets remain permitted on Windows, as before. For non-Windows targets, they error if we had previously done so in other positions.
How
We modify rustc_ast_lowering to prevent unsupported ABIs from leaking through the HIR without being checked for target support. They now emit hard errors for every case where we would return Invalid from AbiMap::canonize_abi. Previously ad-hoc checking on various HIR items required making sure we check every HIR item which could contain an extern "{abi}" string. This is a losing proposition compared to gating the lowering itself.
As a consequence, unsupported ABI strings error instead of triggering the warning unsupported_fn_ptr_calling_conventions. The code is also simpler compared to alternative implementations that might e.g. split on unstable vs. stable, only suffering some unavoidable complication to support the newly-revived unsupported_calling_conventions lint.[^5]
However, per rust-lang#86232 this does cause errors for rare usages of extern "{abi}" that were theoretically possible to write in Rust source, without previous warning or error. For instance, trait declarations without impls were never checked. These are the exact kinds of leakages that this new approach prevents.
This differs from the following PRs:
- rust-lang#141435 is orthogonal, as it adds a new lint for ABIs we have not warned on and are not touched by this PR
- rust-lang#141877 is subsumed by this, in that this simply cuts out bad functionality instead of adding epicycles for stable code
Why or Why Not
We already made the decision to issue the unsupported_fn_ptr_calling_conventions future compatibility warning. It has warned in dependencies since rust-lang#135767, which reached stable with Rust 1.87. That was released on 2025 May 17, and it is now June. As we already had erred on these ABI strings in most other positions, and warn on stable for function pointer types, this breakage has had reasonable foreshadowing.
Upgrading the warning to an error addresses a real problem. In some cases the Rust compiler can attempt to actually compute the ABI for calling a function with an unsupported ABI. We could accept this case and compute unsupported ABIs according to some other ABI, silently[^6]. However, this obviously exposes Rust to errors in codegen. We cannot lower directly to the "obvious", target-incorrect ABI and then trust code generators like LLVM to reliably error on these cases, either.
Other considerations include:
- We could refactor the compiler to defer ABI computations, but that seems like it would suffer the "whack-a-mole" problem close to linking instead of after parsing and expansion.
- We could run a deprecation cycle for the edge cases, but we would be warning highly marginal cases, like this trait declaration without a definition that cannot be implemented without error[^9].
pub trait UsedToSneakBy {
pub extern "gpu-kernel" fn sneaky();
}- The [crater run] on this PR's draft form suggests the primary issue is with implementations on function pointers, which has already been warned on, so it does not seem like we would be benefiting any real code.
- Converting this to a hard error now, in the same cycle that we ship the reanimation of the
unsupported_calling_conventionslint, means people who would otherwise have to deal with two lints only have to update their code in one batch. Of course, one of them is as breakage.
r? lang
Fixes rust-lang#86232 Fixes rust-lang#132430 Fixes rust-lang#138738 Fixes rust-lang#142107
[crater run]: rust-lang#142134 (comment)
[^9]: Upon any impl, even for provided fn within trait declarations, e.g. pub extern "gpu-kernel" fn sneaky() {}, different HIR types were used which would, in fact, get checked. Likewise for anything with function pointers. Thus we would be discussing deprecation cycles for code that is impotent or forewarned[^7].
[^4]: Some already will not compile, due to reaching ICEs or LLVM errors.
[^5]: That lint cannot be moved in a similar way yet because lints operate on HIR, so you cannot emit lints when the HIR has not been completely formed.
[^6]: We already do this for all AbiStr we cannot parse, pretending they are ExternAbi::Rust, but we also emit an error to prevent reaching too far into codegen.
[^7]: It actually did appear in two cases in rustc's test suite because we are a collection of Rust edge-cases by the simple fact that we don't care if the code actually runs. These cases are being excised in 643a9d2
rust-timer added a commit that referenced this pull request
Rollup merge of #142134 - workingjubilee:reject-unsupported-abi, r=jdonszelmann,RalfJung
Reject unsupported extern "{abi}"s consistently in all positions
Modify the handling of extern "{abi}" in the compiler so that it has consistent errors without regard to the position in the grammar.
What
Implement the following breakages:
- Promote
unsupported_fn_ptr_calling_conventionsfrom a warning to a hard error - Guarantee future edge-cases like trait declarations will not escape so that ABIs that have already been unusable in most positions will now be unusable in all positions. See "How" and "Why or Why Not" for more details.
In particular, these architecture-specific ABIs now only compile on their architectures[^4]:
- amdgpu: "gpu-kernel"
- arm: "aapcs", "C-cmse-nonsecure-entry", "C-cmse-nonsecure-call"
- avr: "avr-interrupt", "avr-non-blocking-interrupt"
- msp430: "msp430-interrupt"
- nvptx64: "gpu-kernel", "ptx-kernel"
- riscv32 and riscv64: "riscv-interrupt-m", "riscv-interrupt-s"
- x86: "thiscall"
- x86 and x86_64: "x86-interrupt"
- x86_64: "sysv64", "win64"
ABIs that are logically x86-specific but actually permitted on all Windows targets remain permitted on Windows, as before. For non-Windows targets, they error if we had previously done so in other positions.
How
We modify rustc_ast_lowering to prevent unsupported ABIs from leaking through the HIR without being checked for target support. They now emit hard errors for every case where we would return Invalid from AbiMap::canonize_abi. Previously ad-hoc checking on various HIR items required making sure we check every HIR item which could contain an extern "{abi}" string. This is a losing proposition compared to gating the lowering itself.
As a consequence, unsupported ABI strings error instead of triggering the warning unsupported_fn_ptr_calling_conventions. The code is also simpler compared to alternative implementations that might e.g. split on unstable vs. stable, only suffering some unavoidable complication to support the newly-revived unsupported_calling_conventions lint.[^5]
However, per #86232 this does cause errors for rare usages of extern "{abi}" that were theoretically possible to write in Rust source, without previous warning or error. For instance, trait declarations without impls were never checked. These are the exact kinds of leakages that this new approach prevents.
This differs from the following PRs:
- #141435 is orthogonal, as it adds a new lint for ABIs we have not warned on and are not touched by this PR
- #141877 is subsumed by this, in that this simply cuts out bad functionality instead of adding epicycles for stable code
Why or Why Not
We already made the decision to issue the unsupported_fn_ptr_calling_conventions future compatibility warning. It has warned in dependencies since #135767, which reached stable with Rust 1.87. That was released on 2025 May 17, and it is now June. As we already had erred on these ABI strings in most other positions, and warn on stable for function pointer types, this breakage has had reasonable foreshadowing.
Upgrading the warning to an error addresses a real problem. In some cases the Rust compiler can attempt to actually compute the ABI for calling a function with an unsupported ABI. We could accept this case and compute unsupported ABIs according to some other ABI, silently[^6]. However, this obviously exposes Rust to errors in codegen. We cannot lower directly to the "obvious", target-incorrect ABI and then trust code generators like LLVM to reliably error on these cases, either.
Other considerations include:
- We could refactor the compiler to defer ABI computations, but that seems like it would suffer the "whack-a-mole" problem close to linking instead of after parsing and expansion.
- We could run a deprecation cycle for the edge cases, but we would be warning highly marginal cases, like this trait declaration without a definition that cannot be implemented without error[^9].
pub trait UsedToSneakBy {
pub extern "gpu-kernel" fn sneaky();
}- The [crater run] on this PR's draft form suggests the primary issue is with implementations on function pointers, which has already been warned on, so it does not seem like we would be benefiting any real code.
- Converting this to a hard error now, in the same cycle that we ship the reanimation of the
unsupported_calling_conventionslint, means people who would otherwise have to deal with two lints only have to update their code in one batch. Of course, one of them is as breakage.
r? lang
Fixes #86232 Fixes #132430 Fixes #138738 Fixes #142107
[crater run]: #142134 (comment)
[^9]: Upon any impl, even for provided fn within trait declarations, e.g. pub extern "gpu-kernel" fn sneaky() {}, different HIR types were used which would, in fact, get checked. Likewise for anything with function pointers. Thus we would be discussing deprecation cycles for code that is impotent or forewarned[^7].
[^4]: Some already will not compile, due to reaching ICEs or LLVM errors.
[^5]: That lint cannot be moved in a similar way yet because lints operate on HIR, so you cannot emit lints when the HIR has not been completely formed.
[^6]: We already do this for all AbiStr we cannot parse, pretending they are ExternAbi::Rust, but we also emit an error to prevent reaching too far into codegen.
[^7]: It actually did appear in two cases in rustc's test suite because we are a collection of Rust edge-cases by the simple fact that we don't care if the code actually runs. These cases are being excised in 643a9d2