Skip to content

Warning: type alias is never used: Foo but it's used in newtype patern. #43225

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

Closed
Stargateur opened this issue Jul 13, 2017 · 1 comment
Closed
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@Stargateur
Copy link
Contributor

Stargateur commented Jul 13, 2017

This simple code:

type Foo = i32;
struct Bar(Foo);

fn main() {
    let bar = Bar(42);

    println!("{:?}", bar.0);
}

produce the following warning:

   Compiling rustc 1.18.0
warning: type alias is never used: `Foo`
 --> src/main.rs:1:1
  |
1 | type Foo = i32;
  | ^^^^^^^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

This issue is probably related to #43123

@Stargateur Stargateur changed the title warning: type alias is never used: Underlying but it's used in newtype patern. Warning: type alias is never used: Underlying but it's used in newtype patern. Jul 13, 2017
@Stargateur Stargateur changed the title Warning: type alias is never used: Underlying but it's used in newtype patern. Warning: type alias is never used: Foo but it's used in newtype patern. Jul 13, 2017
@sanxiyn sanxiyn added the A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. label Jul 14, 2017
@Mark-Simulacrum
Copy link
Member

Closing in favor of #18290.

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.
Projects
None yet
Development

No branches or pull requests

3 participants