Skip to content

Trait methods that return an unsized type only error when implementing trait #26204

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

Closed
Aatch opened this issue Jun 11, 2015 · 3 comments
Closed
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@Aatch
Copy link
Contributor

Aatch commented Jun 11, 2015

This doesn't cause an error:

trait A { }
trait B { fn foo() -> A; }

despite the fact you wouldn't be able to ever implement B.

Making this an error should be fine for backwards compatiblity, since you'd not be able to implement the trait anyway. It's a bit confusing that the error is only when implementing the trait.

@Aatch Aatch added I-papercut T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Jun 11, 2015
@apasel422
Copy link
Contributor

Possibly related to #19182.

@arielb1
Copy link
Contributor

arielb1 commented Jun 17, 2015

I think this is by-design according to @nikomatsakis

@arielb1
Copy link
Contributor

arielb1 commented Aug 14, 2015

closed as by-design.

@arielb1 arielb1 closed this as completed Aug 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants