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
If I have a public function or method which uses an impl Trait in return position:
pubfnfoo() -> implTrait{todo!()}
What is the SemVer policy regarding migrating off impl Trait to a concrete type Bar that implements Trait?
pubfnfoo() -> Bar{}implTraitforBar{// omitted}
The purpose of this would be defining additional methods on Bar. I suspect it ought to be a minor change but maybe I'm missing something.
The text was updated successfully, but these errors were encountered:
fuzzypixelz
changed the title
SemVer Compatibility of migrating off an impl Trait in function return position
SemVer Compatibility & migrating off an impl Trait in function return position
Oct 22, 2024
The trait object may be capturing generics that may not be obvious. 1.82 added explicit control over this, and the 2024 edition will be changing the default (see https://blog.rust-lang.org/2024/09/05/impl-trait-capture-rules.html). I'm not certain exactly how that could be a breaking change, but would need some consideration.
I'm going to close in favor of #8736 since this is already on the list. Since there may be dozens (hundreds?) of semver rules, I'm trying to avoid opening separate issues for each one at this time.
You may want to ask this question on the users forum. Another venue for discussion might be cargo semver-checks which provides a programmatic checking for semver compatibility.
If I have a public function or method which uses an impl Trait in return position:
What is the SemVer policy regarding migrating off impl Trait to a concrete type
Bar
that implementsTrait
?The purpose of this would be defining additional methods on
Bar
. I suspect it ought to be a minor change but maybe I'm missing something.The text was updated successfully, but these errors were encountered: