From c09d4e7b0f08fd618b72eb3786afe1520f7b1d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 5 Jan 2019 15:40:10 +0100 Subject: [PATCH 1/3] submodules: update clippy from 39bd8449 to c63b6349 Changes: ```` Revert "tests: used_underscore_binding_macro: disable random_state lint." Revert "Auto merge of #3603 - xfix:random-state-lint, r=phansch" rustup https://github.com/rust-lang/rust/pull/56837 rustup (don't know the exact PR unfortunately) Add itertools to integration tests tests: used_underscore_binding_macro: disable random_state lint. Trigger `use_self` lint in local macros Add run-rustfix where it already passes rustup: https://github.com/rust-lang/rust/pull/55517 Make clippy work with parallel rustc Add ui/for_kv_map test for false positive in #1279 Update to latest compiletest-rs release add testcase for #3462 deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case... Use compiletest's aux-build header instead of include macro rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version rustfmt UI test cleanup: Extract ifs_same_cond tests Extract IteratorFalsePositives into option_helpers.rs UI test cleanup: Extract for_kv_map lint tests UI test cleanup: Extract lint from methods.rs test Fix test for rust-lang/rust#57250 Limit infinite_iter collect() check to known types Some improvements to util documentation Use hashset for name blacklist Reformat random_state tests Use node_id_to_type_opt instead of node_it_to_type in random_state Check pattern equality while checking declaration equality random_state lint Move constant write checks to temporary_assignment lint Use an FxHashSet for valid idents in documentation lint Fix suggestion for unnecessary_ref lint Update CONTRIBUTING.md for rustfix tests Update .fixed files via update-references.sh Run rustfix on first UI test Use WIP branch for compiletest_rs ```` --- Cargo.lock | 25 ++++++++++++++++--------- Cargo.toml | 1 - src/tools/clippy | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef28723b49317..7efe663602f2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -322,12 +322,12 @@ dependencies = [ "clippy-mini-macro-test 0.2.0", "clippy_dev 0.0.1", "clippy_lints 0.0.212", - "compiletest_rs 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "compiletest_rs 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-workspace-hack 1.0.0", - "rustc_tools_util 0.1.0", + "rustc_tools_util 0.1.1", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", @@ -441,7 +441,7 @@ dependencies = [ [[package]] name = "compiletest_rs" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -451,6 +451,7 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustfix 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1381,7 +1382,7 @@ dependencies = [ "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "cargo_metadata 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "compiletest_rs 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "compiletest_rs 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", "directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1812,7 +1813,7 @@ name = "rand_chacha" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1834,7 +1835,7 @@ name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1859,7 +1860,7 @@ name = "rand_xorshift" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1983,7 +1984,7 @@ dependencies = [ "rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-workspace-hack 1.0.0", - "rustc_tools_util 0.1.0", + "rustc_tools_util 0.1.0 (git+https://github.com/rust-lang/rust-clippy?rev=a3c77f6ad1c1c185e561e9cd7fdec7db569169d1)", "rustfmt-nightly 1.0.1", "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2633,6 +2634,11 @@ dependencies = [ [[package]] name = "rustc_tools_util" version = "0.1.0" +source = "git+https://github.com/rust-lang/rust-clippy?rev=a3c77f6ad1c1c185e561e9cd7fdec7db569169d1#a3c77f6ad1c1c185e561e9cd7fdec7db569169d1" + +[[package]] +name = "rustc_tools_util" +version = "0.1.1" [[package]] name = "rustc_traits" @@ -3415,7 +3421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007" "checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" "checksum compiler_builtins 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bd14d75a16b6c836c62350e2e8c85495ed8e13df30a7298c574cb1ee4cdac7bc" -"checksum compiletest_rs 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "89747fe073b7838343bd2c2445e7a7c2e0d415598f8925f0fa9205b9cdfc48cb" +"checksum compiletest_rs 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0d76d4322a40f6b0db7259d4f2c8a65ed8b0d84fce0bbc61b98cf47f8ec6eec3" "checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" @@ -3593,6 +3599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c6d5a683c6ba4ed37959097e88d71c9e8e26659a3cb5be8b389078e7ad45306" "checksum rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40f06724db71e18d68b3b946fdf890ca8c921d9edccc1404fdfdb537b0d12649" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +"checksum rustc_tools_util 0.1.0 (git+https://github.com/rust-lang/rust-clippy?rev=a3c77f6ad1c1c185e561e9cd7fdec7db569169d1)" = "" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustfix 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "af7c21531a91512a4a51b490be6ba1c8eff34fdda0dc5bf87dc28d86748aac56" "checksum rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9591f190d2852720b679c21f66ad929f9f1d7bb09d1193c26167586029d8489c" diff --git a/Cargo.toml b/Cargo.toml index c693985a2ad83..cb3c0ee194fe2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,4 +70,3 @@ rustc-std-workspace-core = { path = 'src/tools/rustc-std-workspace-core' } [patch."https://github.com/rust-lang/rust-clippy"] clippy_lints = { path = "src/tools/clippy/clippy_lints" } -rustc_tools_util = { path = "src/tools/clippy/rustc_tools_util" } diff --git a/src/tools/clippy b/src/tools/clippy index 39bd84494f4a9..c63b6349b4401 160000 --- a/src/tools/clippy +++ b/src/tools/clippy @@ -1 +1 @@ -Subproject commit 39bd84494f4a9b40f2e3b38416a91d52d5c4738b +Subproject commit c63b6349b44019146cc2edcef8141692891b9401 From 495fc5ee9dd00b02eb837256d98284f2f3acc61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 5 Jan 2019 15:44:23 +0100 Subject: [PATCH 2/3] submodules: update rls from 6f5e4bb to 1a6361b Changes: ```` Update Clippy Move TestFailures when collecting failures Update languageserver-types to 0.51.1 update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io Work around https://github.com/rust-lang/rust/pull/55937 Update Clippy... again Update Clippy Update clippy ```` --- Cargo.lock | 8 ++++---- src/tools/rls | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7efe663602f2a..1ea872cc34241 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1984,7 +1984,7 @@ dependencies = [ "rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-workspace-hack 1.0.0", - "rustc_tools_util 0.1.0 (git+https://github.com/rust-lang/rust-clippy?rev=a3c77f6ad1c1c185e561e9cd7fdec7db569169d1)", + "rustc_tools_util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustfmt-nightly 1.0.1", "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2633,12 +2633,12 @@ dependencies = [ [[package]] name = "rustc_tools_util" -version = "0.1.0" -source = "git+https://github.com/rust-lang/rust-clippy?rev=a3c77f6ad1c1c185e561e9cd7fdec7db569169d1#a3c77f6ad1c1c185e561e9cd7fdec7db569169d1" +version = "0.1.1" [[package]] name = "rustc_tools_util" version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rustc_traits" @@ -3599,7 +3599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c6d5a683c6ba4ed37959097e88d71c9e8e26659a3cb5be8b389078e7ad45306" "checksum rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40f06724db71e18d68b3b946fdf890ca8c921d9edccc1404fdfdb537b0d12649" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" -"checksum rustc_tools_util 0.1.0 (git+https://github.com/rust-lang/rust-clippy?rev=a3c77f6ad1c1c185e561e9cd7fdec7db569169d1)" = "" +"checksum rustc_tools_util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c5a95edfa0c893236ae4778bb7c4752760e4c0d245e19b5eff33c5aa5eb9dc" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustfix 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "af7c21531a91512a4a51b490be6ba1c8eff34fdda0dc5bf87dc28d86748aac56" "checksum rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9591f190d2852720b679c21f66ad929f9f1d7bb09d1193c26167586029d8489c" diff --git a/src/tools/rls b/src/tools/rls index 6f5e4bba7b158..1a6361bd399a9 160000 --- a/src/tools/rls +++ b/src/tools/rls @@ -1 +1 @@ -Subproject commit 6f5e4bba7b1586fca6e0ea7724cadb5683b2f308 +Subproject commit 1a6361bd399a9466deba9b42ff2ff2ae365c5d0e From c5101b6dffd2c917e1670ee0d94a146cc075f956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 6 Jan 2019 13:55:15 +0100 Subject: [PATCH 3/3] Revert "Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton" This reverts commit 68614265d312fc2cbe8a696f7dabb9416eb6f221, reversing changes made to cae623c5ce12df8f237264d8f2c31fdaa664c382. Should fix tools on windows. Reopens #57014 --- src/librustc/session/filesearch.rs | 7 ------ src/librustc_driver/lib.rs | 40 ++++++++++++++++-------------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/librustc/session/filesearch.rs b/src/librustc/session/filesearch.rs index c6e68ba379ec3..19f1c7a18fad1 100644 --- a/src/librustc/session/filesearch.rs +++ b/src/librustc/session/filesearch.rs @@ -114,13 +114,6 @@ pub fn make_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf { sysroot.join(&relative_target_lib_path(sysroot, target_triple)) } -pub fn target_lib_path(target_triple: &str) -> PathBuf { - let mut p = PathBuf::from(RUST_LIB_DIR); - p.push(target_triple); - p.push("lib"); - p -} - pub fn get_or_default_sysroot() -> PathBuf { // Follow symlinks. If the resolved path is relative, make it absolute. fn canonicalize(path: Option) -> Option { diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 20a3009378d37..1ec14fbb06c79 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -269,35 +269,37 @@ fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box { } let target = session::config::host_triple(); - // get target libdir path based on executable binary path - let sysroot = filesearch::get_or_default_sysroot(); - let mut libdir_candidates = vec![filesearch::make_target_lib_path(&sysroot, &target)]; + let mut sysroot_candidates = vec![filesearch::get_or_default_sysroot()]; let path = current_dll_path() .and_then(|s| s.canonicalize().ok()); if let Some(dll) = path { - // use `parent` once to chop off the file name - if let Some(path) = dll.parent() { + // use `parent` twice to chop off the file name and then also the + // directory containing the dll which should be either `lib` or `bin`. + if let Some(path) = dll.parent().and_then(|p| p.parent()) { // The original `path` pointed at the `rustc_driver` crate's dll. // Now that dll should only be in one of two locations. The first is - // in the compiler's libdir, for example `$sysroot/$libdir/*.dll`. The + // in the compiler's libdir, for example `$sysroot/lib/*.dll`. The // other is the target's libdir, for example - // `$sysroot/$libdir/rustlib/$target/lib/*.dll`. + // `$sysroot/lib/rustlib/$target/lib/*.dll`. // // We don't know which, so let's assume that if our `path` above - // doesn't end in `$target` we *could* be in the main libdir, and always - // assume that we may be in the target libdir. - libdir_candidates.push(path.to_owned()); - - if !path.parent().map_or(false, |p| p.ends_with(target)) { - libdir_candidates.push(path.join(filesearch::target_lib_path(target))); + // ends in `$target` we *could* be in the target libdir, and always + // assume that we may be in the main libdir. + sysroot_candidates.push(path.to_owned()); + + if path.ends_with(target) { + sysroot_candidates.extend(path.parent() // chop off `$target` + .and_then(|p| p.parent()) // chop off `rustlib` + .and_then(|p| p.parent()) // chop off `lib` + .map(|s| s.to_owned())); } } } - let sysroot = libdir_candidates.iter() - .map(|libdir| { - debug!("Trying target libdir: {}", libdir.display()); - libdir.with_file_name( + let sysroot = sysroot_candidates.iter() + .map(|sysroot| { + let libdir = filesearch::relative_target_lib_path(&sysroot, &target); + sysroot.join(libdir).with_file_name( option_env!("CFG_CODEGEN_BACKENDS_DIR").unwrap_or("codegen-backends")) }) .filter(|f| { @@ -306,12 +308,12 @@ fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box { }) .next(); let sysroot = sysroot.unwrap_or_else(|| { - let candidates = libdir_candidates.iter() + let candidates = sysroot_candidates.iter() .map(|p| p.display().to_string()) .collect::>() .join("\n* "); let err = format!("failed to find a `codegen-backends` folder \ - in the libdir candidates:\n* {}", candidates); + in the sysroot candidates:\n* {}", candidates); early_error(ErrorOutputType::default(), &err); }); info!("probing {} for a codegen backend", sysroot.display());