Skip to content

default_type_params bug: does not implement any method in scope named error #18761

@carllerche

Description

@carllerche

I hit some more unexpected behavior with default_type_params which is probably just a bad error message.

Code

#![feature(default_type_params)]

pub trait Foo<A, B = ()> {}

pub struct Wrap<F> {
    foo: F,
}

impl<A: Send, F: Foo<A>> Wrap<F> {
    fn stuff(&self) {
    }
}

struct MyFoo;

impl Foo<uint, uint> for MyFoo {}

pub fn main() {
    let w = Wrap { foo: MyFoo };
    w.stuff();
}

Output

rustc repro2.rs
repro2.rs:20:7: 20:14 error: type `Wrap<MyFoo>` does not implement any method in scope named `stuff`
repro2.rs:20     w.stuff();
                   ^~~~~~~
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions