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

Spurious unused type alias warning (regression) #41203

Closed
jseyfried opened this issue Apr 10, 2017 · 15 comments
Closed

Spurious unused type alias warning (regression) #41203

jseyfried opened this issue Apr 10, 2017 · 15 comments
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. 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

@jseyfried
Copy link
Contributor

jseyfried commented Apr 10, 2017

This example produced a spurious unused type alias warning:

struct S<T>(T);
type Alias<T> = S<T>;

trait Tr<T> { fn f(&self) {} }
impl<T> Tr<T> for S<T> {}

impl<T> S<T> where Alias<T>: Tr<T> {
    fn g(&self) { self.f() }
}

fn main() {
    S(0).g();
}
@Mark-Simulacrum
Copy link
Member

Bisected regression to aedb49c -- rollup #39199; not really sure what PR in there this was caused by. Nominating for compiler discussion since regression without priority, though this is in stable now so not overly important I guess.

@Mark-Simulacrum Mark-Simulacrum added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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 May 31, 2017
@eddyb
Copy link
Member

eddyb commented Jun 1, 2017

@Mark-Simulacrum What's the "before" on that bisection? I've looked through the entire rollup and I can't find anything that would change the behavior there.

@Mark-Simulacrum
Copy link
Member

Never mind -- sorry for the runaround, my bisect was broken, missing libstdc++6; this does not bisect to any point since 2017-01-13.

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Jun 8, 2017

@jseyfried says they had this working on a nightly from October without warning.

@nikomatsakis
Copy link
Contributor

triage: P-high

@rust-highfive rust-highfive added P-high High priority and removed I-nominated labels Jun 8, 2017
@brson
Copy link
Contributor

brson commented Jun 15, 2017

@jseyfried do you mind self-assigning this P-high regression and taking a look?

@jseyfried
Copy link
Contributor Author

@brson sure.

@jseyfried jseyfried self-assigned this Jun 15, 2017
@sanxiyn
Copy link
Member

sanxiyn commented Jul 13, 2017

#38051 implementing unused type alias landed in December, so of course October nightly would work.

@brson
Copy link
Contributor

brson commented Jul 13, 2017

cc @rust-lang/compiler another P-high bug

@Mark-Simulacrum
Copy link
Member

I can't find an issue, but I seem to recall this being a known problem of not checking impl signatures (everything outside the body) for "use"

@jseyfried
Copy link
Contributor Author

jseyfried commented Jul 13, 2017

This was introduced between nightly-2016-12-16 (8f02c42) and nightly-2016-12-19 (71c06a5).
I suspect #38051.

@nikomatsakis
Copy link
Contributor

Heh, sounds like a likely candidate!

@nikomatsakis
Copy link
Contributor

@sanxiyn think you'll have time to investigate @jseyfried's hypothesis?

@Mark-Simulacrum
Copy link
Member

Arguably this is the same/similar bug as #18290 (this is the bug I was looking for earlier).

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@Mark-Simulacrum
Copy link
Member

Closing as a duplicate of #18290.

@Mark-Simulacrum Mark-Simulacrum marked this as a duplicate of #18290 Jul 27, 2017
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. C-bug Category: This is a bug. 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

No branches or pull requests

7 participants