Skip to content

rustc doesn't reject incompatible trait and impl methods w.r.t argument bounds  #13629

Closed
@edwardw

Description

@edwardw

The following is extracted from libnative / libgreen implementation of std::rt::Runtime:

pub trait Runtime {
    fn spawn_sibling(&self, f: proc():Send);
}

pub struct Foo;
impl Runtime for Foo {
    fn spawn_sibling(&self, _f: proc()) {}
}

fn main() {}

The implementation misses the Send bound of one of its argument so it should not compile, but currently it does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions