Skip to content

Associated types should permit arbitrary bounds #18178

Closed
@carllerche

Description

@carllerche

Based on my understanding of the RFC, associated types should be able to specify bounds, yet the following does not work:

#![feature(associated_types)]

pub trait Cancel {
    fn cancel(self);
}

pub trait Foo {
    type C: Cancel;

    fn stuff(self) -> <Self as Foo>::C;
}

pub fn main() {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions