Skip to content
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

SemVer Compatibility & migrating off an impl Trait in function return position #14714

Closed
fuzzypixelz opened this issue Oct 22, 2024 · 1 comment

Comments

@fuzzypixelz
Copy link

fuzzypixelz commented Oct 22, 2024

If I have a public function or method which uses an impl Trait in return position:

pub fn foo() -> impl Trait {
  todo!()
}

What is the SemVer policy regarding migrating off impl Trait to a concrete type Bar that implements Trait?

pub fn foo() -> Bar {}

impl Trait for Bar {
  // 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.

@fuzzypixelz 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
@ehuss
Copy link
Contributor

ehuss commented Oct 22, 2024

Unfortunately I don't have a definitive answer for you. There are a few potential concerns:

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.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants