Skip to content

Associated types are *not* Sized when used in the return type of default methods #20009

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
japaric opened this issue Dec 19, 2014 · 0 comments · Fixed by #20404
Closed

Associated types are *not* Sized when used in the return type of default methods #20009

japaric opened this issue Dec 19, 2014 · 0 comments · Fixed by #20404

Comments

@japaric
Copy link
Member

japaric commented Dec 19, 2014

STR

#![feature(associated_types)]

trait Trait {
    type Output;

    // Here `Output` is `Sized`
    fn is(&self) -> Self::Output;
    // But, here it seems that `Output` it's no longer `Sized`
    fn isnt(&self) -> Self::Output {}
    //~^ error: the trait `core::kinds::Sized` is not implemented for the type `Output`
}

fn main() {}

Version

rustc 0.13.0-nightly (2a231594c 2014-12-18 12:21:57 +0000)

cc @nikomatsakis @nick29581

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

Successfully merging a pull request may close this issue.

1 participant