Closed
Description
Up to version 1.83 the following code compiled successfully:
Code
#![feature(arbitrary_self_types)]
struct Foo;
impl Foo {
fn foo(self: &impl std::ops::Deref<Target = Self>) {}
}
With version 1.84 we get the following error:
error[E0801]: invalid generic `self` parameter type: `&impl std::ops::Deref<Target = Self>`
...
note: "type of `self` must not be a method generic parameter type"
Version it worked on
It most recently worked on: 1.83
Version with regression
rustc --version --verbose
:
rustc 1.84.0 (9fc6b4312 2025-01-07)
binary: rustc
commit-hash: 9fc6b43126469e3858e2fe86cafb4f0fd5068869
commit-date: 2025-01-07
host: aarch64-apple-darwin
release: 1.84.0
LLVM version: 19.1.5