Skip to content

[NLL] Spurious warning in the last Nightly #50410

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
leonardo-m opened this issue May 3, 2018 · 1 comment
Closed

[NLL] Spurious warning in the last Nightly #50410

leonardo-m opened this issue May 3, 2018 · 1 comment

Comments

@leonardo-m
Copy link

#![feature(nll)]
fn main() {
    let _ = [1].iter().map(|&x| x);
}

Gives a spurious warning:

warning: variable does not need to be mutable
 --> ...\test.rs:3:29
  |
3 |     let _ = [1].iter().map(|&x| x);
  |                             ^^ help: remove this `mut`
  |
  = note: #[warn(unused_mut)] on by default

If I remove the nll feature the warning goes away.

rustc 1.27.0-nightly (8a37c75a3 2018-05-02)
binary: rustc
commit-hash: 8a37c75a3a661385cc607d934c70e86a9eaf5fd7
commit-date: 2018-05-02
host: x86_64-pc-windows-gnu
release: 1.27.0-nightly
LLVM version: 6.0
@Robbepop
Copy link
Contributor

Robbepop commented May 3, 2018

This is a duplicate of #50343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants