-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make ptr_cast_add_auto_to_object
lint into hard error
#136764
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
Make ptr_cast_add_auto_to_object
lint into hard error
#136764
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
7719195
to
d5f82f6
Compare
This comment has been minimized.
This comment has been minimized.
d5f82f6
to
866c3cf
Compare
@bors try ...in preparation for a crater run. |
…o_to_object-hard-error, r=<try> Make `ptr_cast_add_auto_to_object` lint into hard error In Rust 1.81, we added a FCW lint (including linting in dependencies) against pointer casts that add an auto trait to dyn bounds. This was part of work making casts of pointers involving trait objects stricter, and was part of the work needed to restabilize trait upcasting. We considered just making this a hard error, but opted against it at that time due to breakage found by crater. This breakage was mostly due to the `anymap` crate which has been a persistent problem for us. It's now a year later, and the fact that this is not yet a hard error is giving us pause about stabilizing arbitrary self types and `derive(CoercePointee)`. So let's see about making a hard error of this. r? ghost cc `@adetaylor` `@Darksonn` `@BoxyUwU` `@RalfJung` `@compiler-errors` `@oli-obk` `@WaffleLapkin` Related: - rust-lang#135881 - rust-lang#136702 Tracking: - rust-lang#127323 - rust-lang#44874 - rust-lang#123430
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
@rustbot labels +I-lang-nominated As expected, all the real regressions are due to cc @rust-lang/lang |
We talked about this in triage today. The feeling is that the FCW has been out there long enough, so we're within our rights to do this. @rfcbot fcp merge |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@bors r+ |
@bors rollup |
…uto_to_object-hard-error, r=oli-obk Make `ptr_cast_add_auto_to_object` lint into hard error In Rust 1.81, we added a FCW lint (including linting in dependencies) against pointer casts that add an auto trait to dyn bounds. This was part of work making casts of pointers involving trait objects stricter, and was part of the work needed to restabilize trait upcasting. We considered just making this a hard error, but opted against it at that time due to breakage found by crater. This breakage was mostly due to the `anymap` crate which has been a persistent problem for us. It's now a year later, and the fact that this is not yet a hard error is giving us pause about stabilizing arbitrary self types and `derive(CoercePointee)`. So let's see about making a hard error of this. r? ghost cc `@adetaylor` `@Darksonn` `@BoxyUwU` `@RalfJung` `@compiler-errors` `@oli-obk` `@WaffleLapkin` Related: - rust-lang#135881 - rust-lang#136702 - rust-lang#136776 Tracking: - rust-lang#127323 - rust-lang#44874 - rust-lang#123430
…kingjubilee Rollup of 33 pull requests Successful merges: - rust-lang#136581 (Retire the legacy `Makefile`-based `run-make` test infra) - rust-lang#136764 (Make `ptr_cast_add_auto_to_object` lint into hard error) - rust-lang#136798 (Added documentation for flushing per rust-lang#74348) - rust-lang#136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes) - rust-lang#136975 (Look for `python3` first on MacOS, not `py`) - rust-lang#137240 (Slightly reformat `std::fs::remove_dir_all` error docs) - rust-lang#137303 (Remove `MaybeForgetReturn` suggestion) - rust-lang#137327 (Undeprecate env::home_dir) - rust-lang#137502 (Don't include global asm in `mir_keys`, fix error body synthesis) - rust-lang#137534 ([rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden)) - rust-lang#137565 (Try to point of macro expansion from resolver and method errors if it involves macro var) - rust-lang#137643 (Add DWARF test case for non-C-like `repr128` enums) - rust-lang#137758 (fix usage of ty decl macro fragments in attributes) - rust-lang#137764 (Ensure that negative auto impls are always applicable) - rust-lang#137772 (Fix char count in `Display` for `ByteStr`) - rust-lang#137798 (ci: use ubuntu 24 on arm large runner) - rust-lang#137805 (adjust Layout debug printing to match the internal field name) - rust-lang#137808 (Do not require that unsafe fields lack drop glue) - rust-lang#137820 (Clarify why InhabitedPredicate::instantiate_opt exists) - rust-lang#137825 (Provide more context on resolve error caused from incorrect RTN) - rust-lang#137829 (Stabilize [T]::split_off... methods) - rust-lang#137834 (rustc_fluent_macro: use CARGO_CRATE_NAME instead of CARGO_PKG_NAME) - rust-lang#137850 (Stabilize `box_uninit_write`) - rust-lang#137912 (Do not recover missing lifetime with random in-scope lifetime) - rust-lang#137913 (Allow struct field default values to reference struct's generics) - rust-lang#137923 (Simplify `<Postorder as Iterator>::size_hint`) - rust-lang#137949 (Update MSVC INSTALL.md instructions to recommend VS 2022 + recent Windows 10/11 SDK) - rust-lang#137963 (Add ``dyn`` keyword to `E0373` examples) - rust-lang#137975 (Remove unused `PpMode::needs_hir`) - rust-lang#137986 (Fix some typos) - rust-lang#137991 (Add `avr-none` to SUMMARY.md and platform-support.md) - rust-lang#137993 (Remove obsolete comment from DeduceReadOnly) - rust-lang#137996 (Revert "compiler/rustc_data_structures/src/sync/worker_local.rs: delete "unsafe impl Sync"") r? `@ghost` `@rustbot` modify labels: rollup
…uto_to_object-hard-error, r=oli-obk Make `ptr_cast_add_auto_to_object` lint into hard error In Rust 1.81, we added a FCW lint (including linting in dependencies) against pointer casts that add an auto trait to dyn bounds. This was part of work making casts of pointers involving trait objects stricter, and was part of the work needed to restabilize trait upcasting. We considered just making this a hard error, but opted against it at that time due to breakage found by crater. This breakage was mostly due to the `anymap` crate which has been a persistent problem for us. It's now a year later, and the fact that this is not yet a hard error is giving us pause about stabilizing arbitrary self types and `derive(CoercePointee)`. So let's see about making a hard error of this. r? ghost cc ``@adetaylor`` ``@Darksonn`` ``@BoxyUwU`` ``@RalfJung`` ``@compiler-errors`` ``@oli-obk`` ``@WaffleLapkin`` Related: - rust-lang#135881 - rust-lang#136702 - rust-lang#136776 Tracking: - rust-lang#127323 - rust-lang#44874 - rust-lang#123430
…kingjubilee Rollup of 20 pull requests Successful merges: - rust-lang#136581 (Retire the legacy `Makefile`-based `run-make` test infra) - rust-lang#136764 (Make `ptr_cast_add_auto_to_object` lint into hard error) - rust-lang#136798 (Added documentation for flushing per rust-lang#74348) - rust-lang#136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes) - rust-lang#136975 (Look for `python3` first on MacOS, not `py`) - rust-lang#137240 (Slightly reformat `std::fs::remove_dir_all` error docs) - rust-lang#137303 (Remove `MaybeForgetReturn` suggestion) - rust-lang#137327 (Undeprecate env::home_dir) - rust-lang#137502 (Don't include global asm in `mir_keys`, fix error body synthesis) - rust-lang#137534 ([rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden)) - rust-lang#137565 (Try to point of macro expansion from resolver and method errors if it involves macro var) - rust-lang#137643 (Add DWARF test case for non-C-like `repr128` enums) - rust-lang#137758 (fix usage of ty decl macro fragments in attributes) - rust-lang#137764 (Ensure that negative auto impls are always applicable) - rust-lang#137772 (Fix char count in `Display` for `ByteStr`) - rust-lang#137798 (ci: use ubuntu 24 on arm large runner) - rust-lang#137805 (adjust Layout debug printing to match the internal field name) - rust-lang#137808 (Do not require that unsafe fields lack drop glue) - rust-lang#137820 (Clarify why InhabitedPredicate::instantiate_opt exists) - rust-lang#137825 (Provide more context on resolve error caused from incorrect RTN) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 20 pull requests Successful merges: - rust-lang#134063 (dec2flt: Clean up float parsing modules) - rust-lang#136581 (Retire the legacy `Makefile`-based `run-make` test infra) - rust-lang#136662 (Count char width at most once in `Formatter::pad`) - rust-lang#136764 (Make `ptr_cast_add_auto_to_object` lint into hard error) - rust-lang#136798 (Added documentation for flushing per rust-lang#74348) - rust-lang#136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes) - rust-lang#136975 (Look for `python3` first on MacOS, not `py`) - rust-lang#136977 (Upload Datadog metrics with citool) - rust-lang#137240 (Slightly reformat `std::fs::remove_dir_all` error docs) - rust-lang#137298 (Check signature WF when lowering MIR body) - rust-lang#137463 ([illumos] attempt to use posix_spawn to spawn processes) - rust-lang#137477 (uefi: Add Service Binding Protocol abstraction) - rust-lang#137569 (Stabilize `string_extend_from_within`) - rust-lang#137633 (Only use implied bounds hack if bevy, and use deeply normalize in implied bounds hack) - rust-lang#137679 (Various coretests improvements) - rust-lang#137723 (Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION`) - rust-lang#137728 (Remove unsizing coercions for tuples) - rust-lang#137731 (Resume one waiter at once in deadlock handler) - rust-lang#137875 (mir_build: Integrate "simplification" steps into match-pair-tree creation) - rust-lang#138028 (compiler: add `ExternAbi::is_rustic_abi`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136764 - traviscross:TC/make-ptr_cast_add_auto_to_object-hard-error, r=oli-obk Make `ptr_cast_add_auto_to_object` lint into hard error In Rust 1.81, we added a FCW lint (including linting in dependencies) against pointer casts that add an auto trait to dyn bounds. This was part of work making casts of pointers involving trait objects stricter, and was part of the work needed to restabilize trait upcasting. We considered just making this a hard error, but opted against it at that time due to breakage found by crater. This breakage was mostly due to the `anymap` crate which has been a persistent problem for us. It's now a year later, and the fact that this is not yet a hard error is giving us pause about stabilizing arbitrary self types and `derive(CoercePointee)`. So let's see about making a hard error of this. r? ghost cc ```@adetaylor``` ```@Darksonn``` ```@BoxyUwU``` ```@RalfJung``` ```@compiler-errors``` ```@oli-obk``` ```@WaffleLapkin``` Related: - rust-lang#135881 - rust-lang#136702 - rust-lang#136776 Tracking: - rust-lang#127323 - rust-lang#44874 - rust-lang#123430
…leLapkin Don't emit error within cast function, propagate it as a `CastError` Minor nitpick from rust-lang#136764. r? `@WaffleLapkin`
Rollup merge of rust-lang#138423 - compiler-errors:delay-emit, r=WaffleLapkin Don't emit error within cast function, propagate it as a `CastError` Minor nitpick from rust-lang#136764. r? `@WaffleLapkin`
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [rust](https://github.com/rust-lang/rust) | minor | `1.86.0` -> `1.87.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>rust-lang/rust (rust)</summary> ### [`v1.87.0`](https://github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1870-2025-05-15) [Compare Source](rust-lang/rust@1.86.0...1.87.0) \========================== <a id="1.87.0-Language"></a> ## Language - [Stabilize `asm_goto` feature](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: Sized` bounds in `impl`s for unsized types](rust-lang/rust#135480) - [Stabilize `feature(precise_capturing_in_traits)` allowing `use<...>` bounds on return position `impl Trait` in `trait`s](rust-lang/rust#138128) <a id="1.87.0-Compiler"></a> ## Compiler - [x86: make SSE2 required for i686 targets and use it to pass SIMD types](rust-lang/rust#135408) <a id="1.87.0-Platform-Support"></a> ## Platform Support - [Remove `i586-pc-windows-msvc` target](rust-lang/rust#137957) Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. [platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html <a id="1.87.0-Libraries"></a> ## 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 `Debug` impl of raw pointers](rust-lang/rust#135080) - [`Vec::with_capacity` guarantees it allocates with the amount requested, even if `Vec::capacity` returns a different number.](rust-lang/rust#135933) - Most `std::arch` intrinsics 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 `ControlFlow` as `#[must_use]`](rust-lang/rust#137449) - [Macros such as `assert_eq!` and `vec!` now support `const {...}` expressions](rust-lang/rust#138162) <a id="1.87.0-Stabilized-APIs"></a> ## 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) <a id="1.87.0-Cargo"></a> ## 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) <a id="1.87.0-Compatibility-Notes"></a> ## 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 `Debug` impl 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 `dyn` types 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_object` lint into hard error](rust-lang/rust#136764) - Many `std::arch` intrinsics are now safe to call in some contexts, there may now be new `unused_unsafe` warnings in existing codebases. - [Limit `width` and `precision` formatting 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 `ControlFlow` as `#[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.](rust-lang/rust#138844) - [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 `tt` fragment specifier can often fix these macros. - [Don't allow flattened format_args in const.](rust-lang/rust#139624) <a id="1.87.0-Internal-Changes"></a> ## 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) </details> --- ### 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4xMS4xOSIsInVwZGF0ZWRJblZlciI6IjQwLjExLjE5IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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_goto` feature] (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: Sized` bounds in `impl`s for unsized types] (rust-lang/rust#135480) - [Stabilize `feature(precise_capturing_in_traits)` allowing `use<...>` bounds on return position `impl Trait` in `trait`s] (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-msvc` target] (rust-lang/rust#137957) Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. [platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html 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 `Debug` impl of raw pointers] (rust-lang/rust#135080) - [`Vec::with_capacity` guarantees it allocates with the amount requested, even if `Vec::capacity` returns a different number.] (rust-lang/rust#135933) - Most `std::arch` intrinsics 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 `ControlFlow` as `#[must_use]`] (rust-lang/rust#137449) - [Macros such as `assert_eq!` and `vec!` now support `const {...}` 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 `Debug` impl 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 `dyn` types 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_object` lint into hard error] (rust-lang/rust#136764) - Many `std::arch` intrinsics are now safe to call in some contexts, there may now be new `unused_unsafe` warnings in existing codebases. - [Limit `width` and `precision` formatting 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 `ControlFlow` as `#[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.](rust-lang/rust#138844) - [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 `tt` fragment 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)
Summary: [#136764](rust-lang/rust#136764) breaks the [`anymap`](https://github.com/chris-morgan/anymap) crate via: ``` error[E0804]: cannot add auto traits `Send` and `Sync` to dyn bound via pointer cast --> third-party/rust/vendor/anymap-1.0.0-beta.2/src/any.rs:37:40 | 19 | / macro_rules! impl_clone { 20 | | ($t:ty) => { 21 | | impl Clone for Box<$t> { 22 | | #[inline] ... | 37 | | unsafe { Box::from_raw(raw as *mut $t) } | | ^^^^^^^^^^^^^^ unsupported cast ... | 48 | | } | |_- in this expansion of `impl_clone!` ... 145 | impl_clone!(dyn CloneAny + Send + Sync); | --------------------------------------- in this macro invocation | = note: this could allow UB elsewhere = help: use `transmute` if you're sure this is sound ``` Since `anymap` is not maintained any more, switching everyone to a fork that is i.e. [`anymap3`](https://github.com/reivilibre/anymap3) which also solves the above using the suggested `transmute`. Reviewed By: jsgf Differential Revision: D75098213 fbshipit-source-id: dace0feaca2960508c57d02d229c4a32747ba588
Summary: [#136764](rust-lang/rust#136764) breaks the [`anymap`](https://github.com/chris-morgan/anymap) crate via: ``` error[E0804]: cannot add auto traits `Send` and `Sync` to dyn bound via pointer cast --> third-party/rust/vendor/anymap-1.0.0-beta.2/src/any.rs:37:40 | 19 | / macro_rules! impl_clone { 20 | | ($t:ty) => { 21 | | impl Clone for Box<$t> { 22 | | #[inline] ... | 37 | | unsafe { Box::from_raw(raw as *mut $t) } | | ^^^^^^^^^^^^^^ unsupported cast ... | 48 | | } | |_- in this expansion of `impl_clone!` ... 145 | impl_clone!(dyn CloneAny + Send + Sync); | --------------------------------------- in this macro invocation | = note: this could allow UB elsewhere = help: use `transmute` if you're sure this is sound ``` Since `anymap` is not maintained any more, switching everyone to a fork that is i.e. [`anymap3`](https://github.com/reivilibre/anymap3) which also solves the above using the suggested `transmute`. Reviewed By: jsgf Differential Revision: D75098213 fbshipit-source-id: dace0feaca2960508c57d02d229c4a32747ba588
Summary: [#136764](rust-lang/rust#136764) breaks the [`anymap`](https://github.com/chris-morgan/anymap) crate via: ``` error[E0804]: cannot add auto traits `Send` and `Sync` to dyn bound via pointer cast --> third-party/rust/vendor/anymap-1.0.0-beta.2/src/any.rs:37:40 | 19 | / macro_rules! impl_clone { 20 | | ($t:ty) => { 21 | | impl Clone for Box<$t> { 22 | | #[inline] ... | 37 | | unsafe { Box::from_raw(raw as *mut $t) } | | ^^^^^^^^^^^^^^ unsupported cast ... | 48 | | } | |_- in this expansion of `impl_clone!` ... 145 | impl_clone!(dyn CloneAny + Send + Sync); | --------------------------------------- in this macro invocation | = note: this could allow UB elsewhere = help: use `transmute` if you're sure this is sound ``` Since `anymap` is not maintained any more, switching everyone to a fork that is i.e. [`anymap3`](https://github.com/reivilibre/anymap3) which also solves the above using the suggested `transmute`. Reviewed By: jsgf Differential Revision: D75098213 fbshipit-source-id: dace0feaca2960508c57d02d229c4a32747ba588
In Rust 1.81, we added a FCW lint (including linting in dependencies) against pointer casts that add an auto trait to dyn bounds. This was part of work making casts of pointers involving trait objects stricter, and was part of the work needed to restabilize trait upcasting.
We considered just making this a hard error, but opted against it at that time due to breakage found by crater. This breakage was mostly due to the
anymap
crate which has been a persistent problem for us.It's now a year later, and the fact that this is not yet a hard error is giving us pause about stabilizing arbitrary self types and
derive(CoercePointee)
. So let's see about making a hard error of this.r? ghost
cc @adetaylor @Darksonn @BoxyUwU @RalfJung @compiler-errors @oli-obk @WaffleLapkin
Related:
Tracking:
ptr_cast_add_auto_to_object
#127323arbitrary_self_types
#44874derive(CoercePointee)
#123430