Skip to content

Type alias used in async fn return type is wrongly reported unused #59085

Closed
@Globidev

Description

@Globidev

With rustc 1.35.0-nightly (26b4cb484 2019-03-09)
The following code

type Bar = ();
async fn foo() -> Bar { }

produces the following warning

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

When Bar is clearly used here.
This seem to only trigger if the alias is used in the return type position

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions