Skip to content

Failure to recognize and/or unify ! type with impl Trait in return #74683

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
TyPR124 opened this issue Jul 23, 2020 · 1 comment
Closed

Failure to recognize and/or unify ! type with impl Trait in return #74683

TyPR124 opened this issue Jul 23, 2020 · 1 comment
Labels
C-bug Category: This is a bug.

Comments

@TyPR124
Copy link
Contributor

TyPR124 commented Jul 23, 2020

I couldn't find an issue exactly like this one, but also probably don't know enough to recognize if any existing issue covered this specific case or not.

I tried this code:

fn foo() -> impl Drop {
    todo!()
}

I expected to see this happen: code to compile, just as this would

fn foo() -> u32 {
    todo!()
}

Instead, this happened: code fails to compile, explaining that type () does not implement Drop

Meta

rustc --version --verbose:

rustc 1.46.0-nightly (346aec9b0 2020-07-11)

Also same behavior on the playground

@TyPR124 TyPR124 added the C-bug Category: This is a bug. label Jul 23, 2020
@jonas-schievink
Copy link
Contributor

duplicate of #69882

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants