Skip to content

two ways to get RPITs into non-self positions in their item-bounds #19

@lcnr

Description

@lcnr
trait DefaultParam<R: ?Sized = Self> {}
impl<T> DefaultParam for T {}
fn foo() -> impl DefaultParam {}

trait Super<T: ?Sized> {}
impl<T, U> Super<T> for U {}
trait Sub: Super<Self> {}
impl<T> Sub for T {}
fn bar() -> impl Sub {}

currently unstable ways:

  • TAIT
  • trait aliases

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions