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

Concrete type only used in impl Trait is unused #55124

Closed
cramertj opened this issue Oct 16, 2018 · 6 comments · Fixed by #56456
Closed

Concrete type only used in impl Trait is unused #55124

cramertj opened this issue Oct 16, 2018 · 6 comments · Fixed by #56456
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@cramertj
Copy link
Member

The following code gives "warning: enum is never used: Empty":

enum Empty { }
trait Bar<T> {}
impl Bar<Empty> for () {}

fn boo() -> impl Bar<Empty> {}

fn main() {
    boo();
}

This regressed pretty recently. cc @oli-obk

@jonas-schievink
Copy link
Contributor

1.27.0 does not warn, 1.28.0 does.

@estebank estebank added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. labels Oct 16, 2018
@pnkfelix
Copy link
Member

triage: P-medium; This seems like a papercut that should be easy to work-around (at least if one isn't using forbid...).

@pnkfelix pnkfelix added P-medium Medium priority P-high High priority and removed P-medium Medium priority labels Nov 29, 2018
@pnkfelix
Copy link
Member

switched to P-high after prompting from @nikomatsakis

@pnkfelix
Copy link
Member

whoops forgot to tag with T-compiler in time for the meeting...

@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 29, 2018
@pnkfelix
Copy link
Member

assigning to @nikomatsakis

@oli-obk
Copy link
Contributor

oli-obk commented Dec 3, 2018

I'm grabbing this, I think I broke it and it should be easy to fix

kennytm added a commit to kennytm/rust that referenced this issue Dec 4, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Dec 4, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Dec 5, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this issue Dec 5, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this issue Dec 5, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Aug 18, 2021
…i-obk

Move private_unused.rs test to impl-trait

This test was added to fix this issue rust-lang#55124 which is about impl traits but not related with type alias impl traits.

r? `@oli-obk`

`@bors` rollup=always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants