Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Document when associated types may be omitted from dyn Trait type #1933

Open

Description

@traviscross

We accept this,

pub trait Tr {
    type Ty;
}
fn f(_: &dyn Tr<Ty = ()>) {}

and we accept this (as of rust-lang/rust#112319),

pub trait Tr {
    type Ty where Self: Sized;
}
fn f(_: &dyn Tr) {}

but we of course don't accept this:

pub trait Tr {
    type Ty;
}
fn f(_: &dyn Tr) {} //~ ERROR

The Reference should speak to this in our chapter on trait object types, but is silent on this matter.

cc @ehuss #1932 rust-lang/rust#127251

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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