]> git.lizzy.rs Git - rust.git/commit
rustc: Only suggest deleting `extern crate` if it works
authorAlex Crichton <alex@alexcrichton.com>
Fri, 11 May 2018 18:31:08 +0000 (11:31 -0700)
committerMark Simulacrum <mark.simulacrum@gmail.com>
Sat, 12 May 2018 14:39:05 +0000 (08:39 -0600)
commitda79ff3cc2265514483d2a5e1f4238c85baa70e9
tree7607352f04a53cfd5821fafb71039deb26e15be5
parent28856327066b9d15662ffd185196366de02c6240
rustc: Only suggest deleting `extern crate` if it works

This commit updates one of the edition lints to only suggest deleting `extern
crate` if it actually works. Otherwise this can yield some confusing behavior
with rustfix specifically where if you accidentally deny the `rust_2018_idioms`
lint in the 2015 edition it's suggesting features that don't work!
src/librustc_lint/builtin.rs
src/test/compile-fail/auxiliary/edition-extern-crate-allowed.rs [new file with mode: 0644]
src/test/compile-fail/edition-extern-crate-allowed.rs [new file with mode: 0644]
src/test/ui-fulldeps/unnecessary-extern-crate.rs
src/test/ui-fulldeps/unnecessary-extern-crate.stderr