←back to thread

128 points RGBCube | 5 comments | | HN request time: 0.211s | source
1. lidavidm ◴[] No.44497766[source]
Someone on the issue they made explained why Clone is "broken": https://github.com/JelteF/derive_more/issues/490#issuecommen...

Which links to this blog post explaining the choice in more detail: https://smallcultfollowing.com/babysteps/blog/2022/04/12/imp...

replies(3): >>44497807 #>>44497874 #>>44498301 #
2. ◴[] No.44497807[source]
3. sbt567 ◴[] No.44497874[source]
from Niko's post:

> In the past, we were blocked for technical reasons from expanding implied bounds and supporting perfect derive, but I believe we have resolved those issues. So now we have to think a bit about semver and decide how much explicit we want to be.

4. samsartor ◴[] No.44498301[source]
I have a crate with a "perfect" derive macro that generates where clauses from the fields instead of putting them on the generic parameters. It is nice when it works, but yah cyclical trait matching is still a real problem. I wound up needing an attribute to manually override the bounds whenever they blow up: https://docs.rs/inpt/latest/inpt/#bounds
replies(1): >>44500154 #
5. mmastrac ◴[] No.44500154[source]
I did a similar thing for derive-io. It greatly improved the ergonomics of the macro.

https://docs.rs/derive-io/latest/derive_io/

Being able to handle directly recursive type bounds would be an awesome improvement to the compiler, IMO.