Skip to content

comparing bounds on impl method type parameters with bounds declared on trait is completely bogus #2687

Closed
@nikomatsakis

Description

@nikomatsakis

Right now, a fn implementing an iface method must match the purity of the iface method exactly. This is too strict. We should allow a pure fn to implement an impure fn, and both pure/impure to implement an unsafe fn.

UPDATE: Updated title to reflect the real problem here. There is a FIXME in the code in the relevant area. If one declares a trait like:

trait Foo {
    fn m<T:Eq>(...);
}

then in the impl, the m method should take one type parameter with an Eq bound. We don't really check this correctly though. As far as I can tell, we just check that m has one type parameter with one bound, but not precisely what kind of bound it is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions