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 type parameters in trait bounds doesn't count for error[E0392]: "parameter A1 is never used". #41083

Closed
roSievers opened this issue Apr 5, 2017 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@roSievers
Copy link

roSievers commented Apr 5, 2017

I have a struct with a bunch of type parameters. Some of them are used for members and some of them are used to nail down the other type parameters.

pub struct MapStatistic<A1, A2, B, Stat, Pre>
    where Stat: Statistic<A2, B>,
          Pre: Fn(A1) -> A2
{
    preprocessor: Pre,
    statistic: Stat,
}

This uses all five type parameters but still triggers error[E0392] complaining about unused type parameters. I can fix it by adding phantom: PhantomData<(A1, A2, B)>, but I believe that shouldn't be necessary.

This issue looks related: #35146
And now that I read it again after posting this comment it might even be the same thing. The lack of where is something I didn't see before.

@roSievers roSievers changed the title Trait bounds don't count for error[E0392], "parameter A1 is never used" Using type parameters in trait bounds doesn't count for error[E0392]: "parameter A1 is never used". Apr 5, 2017
@GuillaumeGomez GuillaumeGomez added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 11, 2017
@Mark-Simulacrum
Copy link
Member

Duplicate of #35146, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints 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