Skip to content

Incorrect "type alias is never used" #42303

@stepancheg

Description

@stepancheg
struct Foo;

type Bar = Foo;

impl Bar {
    fn baz(&self) {}
}

fn main() {
    Foo.baz();
}
rustc 1.17.0 (56124baa9 2017-04-24)
warning: type alias is never used: `Bar`
 --> <anon>:3:1
  |
3 | type Bar = Foo;
  | ^^^^^^^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions