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

Invalid warning unused_mut #50463

Closed
Boscop opened this issue May 5, 2018 · 17 comments
Closed

Invalid warning unused_mut #50463

Boscop opened this issue May 5, 2018 · 17 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Boscop
Copy link

Boscop commented May 5, 2018

I just updated my nightly and now I'm getting this warning:

image

But it's invalid, the binding has to be mutable, otherwise:

image

@sfackler sfackler added the A-diagnostics Area: Messages for errors, warnings, and lints label May 5, 2018
@pietroalbini pietroalbini added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label May 6, 2018
@pietroalbini pietroalbini added this to the 1.27 milestone May 6, 2018
@pietroalbini
Copy link
Member

Thanks for reporting this @Boscop! Unfortunately, I can't reproduce this locally, can you give us a reduced snippet that causes the regression?

@Boscop
Copy link
Author

Boscop commented May 8, 2018

Hm, this snippet causes the same warning on my machine (nightly 05-04) but not in the playground (nightly 05-07):
https://play.rust-lang.org/?gist=424a607550c14b3cb27ce4994bf9fd6c&version=nightly&mode=debug

I'm updating my nightly now to check with the most recent one..

@Boscop
Copy link
Author

Boscop commented May 8, 2018

Hm, even with the most recent nightly 05-07 I get that warning on my machine!

@pietroalbini
Copy link
Member

That's strange, the snippet you provided also compiled fine on my local machine. Can you get the output of rustc +nightly -Vv?

@Boscop
Copy link
Author

Boscop commented May 8, 2018

Hm, it's only when it's part of the larger project (where the warning first appeared).
When I extract it into a new project (same code, as in the playground) it doesn't give that warning!
Unfortunately, I don't know how I can go from here, the large project is 20k lines, but this code is literally the same as in the playground example! Just pasted into the project (without the main function).

@pietroalbini
Copy link
Member

Is the project available somewhere so we can see which PR caused the regression?

@Boscop
Copy link
Author

Boscop commented May 8, 2018

No, it's closed source (for my job) :/

@pietroalbini
Copy link
Member

Sure. If you hop into #rust-release on irc.mozilla.org and ping me I can guide you through bisecting the project yourself.

@pietroalbini pietroalbini added regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels May 9, 2018
@nikomatsakis
Copy link
Contributor

@Boscop -- is this project by any chance using #![feature(nll)]?

@nikomatsakis
Copy link
Contributor

Were you ever able to bisect? The https://github.com/rust-lang-nursery/cargo-bisect-rustc tool might be useful to you. =)

@nikomatsakis nikomatsakis self-assigned this May 10, 2018
@oli-obk
Copy link
Contributor

oli-obk commented May 10, 2018

I can confirm that #![feature(nll)] produces said bug https://play.rust-lang.org/?gist=183af0c42d164e5434852c9e6ad81317&version=nightly&mode=debug

@nikomatsakis nikomatsakis added the P-high High priority label May 10, 2018
@nikomatsakis
Copy link
Contributor

cc @KiChjang -- quite likely another regression to track down

@oli-obk oli-obk added the A-NLL Area: Non-lexical lifetimes (NLL) label May 10, 2018
@nikomatsakis nikomatsakis added WG-compiler-nll T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. P-medium Medium priority and removed A-NLL Area: Non-lexical lifetimes (NLL) P-high High priority labels May 10, 2018
@Boscop
Copy link
Author

Boscop commented May 10, 2018

Ah thanks! Yes, in the big project where it originally occurred I'm using #![feature(nll)].

@alexcrichton
Copy link
Member

@pietroalbini pietroalbini removed the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label May 10, 2018
@pietroalbini pietroalbini removed this from the 1.27 milestone May 10, 2018
@pietroalbini
Copy link
Member

OK, this is not a regression then.

@alexcrichton
Copy link
Member

I've bisected my comment above to #48605 (cc @KiChjang)

@KiChjang
Copy link
Member

I believe it's the same underlying cause as #50461.

bors added a commit that referenced this issue May 18, 2018
Use EverInit instead of MaybeInit to determine initialization

Fixes #50461.
Fixes #50463.
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 P-medium Medium priority 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