Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a type alias in an impl block header doesn't mark it as being used #48815

Closed
glandium opened this issue Mar 7, 2018 · 2 comments
Closed
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-type-system Area: Type system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@glandium
Copy link
Contributor

glandium commented Mar 7, 2018

Reduced testcase courtesy of Arnavion on irc:

pub struct Foo;

type Bar = Foo;

impl Bar {
}

The compiler prints the following error:

warning: type alias is never used: `Bar`
 --> src/main.rs:3:1
  |
3 | type Bar = Foo;
  | ^^^^^^^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default
@Centril Centril added A-type-system Area: Type system A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Mar 7, 2018
@IslandUsurper
Copy link

Duplicate of #47131, perhaps.

@glandium
Copy link
Contributor Author

Indeed, duplicate of #47131.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-type-system Area: Type system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants