You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
Auto merge of rust-lang#138952 - dingxiangfei2009:implicit-receiver-impl, r=<try>
arbitrary_self_type: insert implied Receiver bound on Deref
r? `@nikomatsakis`
This is an experimental setup which allows us to assess the impact from inserting an implied supertrait bound `Deref: Receiver`.
The observations are as follows.
- Thanks to the trait solver, not too many hacks are needed to implement the idea behind [this comment](rust-lang#135881 (comment)), where inductive cycles are admissible.
- We want to allow users to continue use the `dyn Deref` type as `Deref` has been `dyn`-compatible. Following the current `dyn`-compatibility rule, it would have been impossible to use `dyn Deref<Target = ..>` because one would need to write `dyn Deref<..> + Receiver<..>` while neither `Deref` nor `Receiver` is an `auto` trait. This is the main change that this PR proposes: we fill in the missing projection bound that `Receiver` demands from a `dyn Deref` and this will remain the only exception.
- Finally, the type (pretty-)printing is adjusted so as to not present the frivolous `Receiver::Target = ..` bound. It will always be the same term as `Deref::Target`.
I am proposing a crater experiment to see the extent of impact on the existing ecosystem and explore corner cases that I have missed.
0 commit comments