]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #55758 - davidtwco:issue-55344, r=pnkfelix
authorMark Rousskov <mark.simulacrum@gmail.com>
Fri, 9 Nov 2018 01:15:10 +0000 (18:15 -0700)
committerGitHub <noreply@github.com>
Fri, 9 Nov 2018 01:15:10 +0000 (18:15 -0700)
[regression - rust2018]: unused_mut lint false positives on nightly

Fixes #55344.

This commit filters out locals that have never been initialized for
consideration in the `unused_mut` lint.

This is intended to detect when the statement that would have
initialized the local was removed as unreachable code. In these cases,
we would not want to lint. This is the same behaviour as the AST borrow
checker.

This is achieved by taking advantage of an existing pass over the MIR
for the `unused_mut` lint and creating a set of those locals that were
never initialized.

r? @pnkfelix

1  2 
src/librustc/mir/mod.rs

Simple merge