Skip to content

Confusing not trait error message #10361

@klutzy

Description

@klutzy
use t::T;
mod t {
    pub trait T {}
}

struct S;

impl T for S {}

impl T {} // oops

fn main() {}
a.rs:8:5: 8:6 error: T is not a trait
a.rs:8 impl T for S {}
            ^

This should show better error message. If trait T is not in mod, rustc prints "duplicate definition of module T".

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