Skip to content

Commit 8e2063d

Browse files
committed
Auto merge of #57303 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
submodules: update clippy and rls Fixes clippy toolstate Changes: ```` 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... rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version UI test cleanup: Extract ifs_same_cond tests UI test cleanup: Extract for_kv_map lint tests Fix test for #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 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 ```` Also updates RLS and removes the patching of rustc_tool_utils from cargo.toml RLS changes: ```` update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io Work around #55937 Update Clippy... again Update Clippy Update clippy ```` r? @oli-obk
2 parents 59e70f2 + c5101b6 commit 8e2063d

File tree

6 files changed

+40
-39
lines changed

6 files changed

+40
-39
lines changed

Cargo.lock

+17-10
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,12 @@ dependencies = [
322322
"clippy-mini-macro-test 0.2.0",
323323
"clippy_dev 0.0.1",
324324
"clippy_lints 0.0.212",
325-
"compiletest_rs 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
325+
"compiletest_rs 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
326326
"derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
327327
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
328328
"regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
329329
"rustc-workspace-hack 1.0.0",
330-
"rustc_tools_util 0.1.0",
330+
"rustc_tools_util 0.1.1",
331331
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
332332
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
333333
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -441,7 +441,7 @@ dependencies = [
441441

442442
[[package]]
443443
name = "compiletest_rs"
444-
version = "0.3.17"
444+
version = "0.3.18"
445445
source = "registry+https://github.com/rust-lang/crates.io-index"
446446
dependencies = [
447447
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -451,6 +451,7 @@ dependencies = [
451451
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
452452
"miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
453453
"regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
454+
"rustfix 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
454455
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
455456
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
456457
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1381,7 +1382,7 @@ dependencies = [
13811382
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
13821383
"cargo_metadata 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
13831384
"colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
1384-
"compiletest_rs 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
1385+
"compiletest_rs 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
13851386
"directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
13861387
"env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
13871388
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1812,7 +1813,7 @@ name = "rand_chacha"
18121813
version = "0.1.0"
18131814
source = "registry+https://github.com/rust-lang/crates.io-index"
18141815
dependencies = [
1815-
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
1816+
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
18161817
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
18171818
]
18181819

@@ -1834,7 +1835,7 @@ name = "rand_hc"
18341835
version = "0.1.0"
18351836
source = "registry+https://github.com/rust-lang/crates.io-index"
18361837
dependencies = [
1837-
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
1838+
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
18381839
]
18391840

18401841
[[package]]
@@ -1859,7 +1860,7 @@ name = "rand_xorshift"
18591860
version = "0.1.0"
18601861
source = "registry+https://github.com/rust-lang/crates.io-index"
18611862
dependencies = [
1862-
"rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
1863+
"rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
18631864
]
18641865

18651866
[[package]]
@@ -1983,7 +1984,7 @@ dependencies = [
19831984
"rls-vfs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
19841985
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
19851986
"rustc-workspace-hack 1.0.0",
1986-
"rustc_tools_util 0.1.0",
1987+
"rustc_tools_util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
19871988
"rustfmt-nightly 1.0.1",
19881989
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
19891990
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2632,7 +2633,12 @@ dependencies = [
26322633

26332634
[[package]]
26342635
name = "rustc_tools_util"
2635-
version = "0.1.0"
2636+
version = "0.1.1"
2637+
2638+
[[package]]
2639+
name = "rustc_tools_util"
2640+
version = "0.1.1"
2641+
source = "registry+https://github.com/rust-lang/crates.io-index"
26362642

26372643
[[package]]
26382644
name = "rustc_traits"
@@ -3415,7 +3421,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
34153421
"checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007"
34163422
"checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2"
34173423
"checksum compiler_builtins 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bd14d75a16b6c836c62350e2e8c85495ed8e13df30a7298c574cb1ee4cdac7bc"
3418-
"checksum compiletest_rs 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "89747fe073b7838343bd2c2445e7a7c2e0d415598f8925f0fa9205b9cdfc48cb"
3424+
"checksum compiletest_rs 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0d76d4322a40f6b0db7259d4f2c8a65ed8b0d84fce0bbc61b98cf47f8ec6eec3"
34193425
"checksum core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4e2640d6d0bf22e82bed1b73c6aef8d5dd31e5abe6666c57e6d45e2649f4f887"
34203426
"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
34213427
"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"
35933599
"checksum rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c6d5a683c6ba4ed37959097e88d71c9e8e26659a3cb5be8b389078e7ad45306"
35943600
"checksum rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40f06724db71e18d68b3b946fdf890ca8c921d9edccc1404fdfdb537b0d12649"
35953601
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
3602+
"checksum rustc_tools_util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c5a95edfa0c893236ae4778bb7c4752760e4c0d245e19b5eff33c5aa5eb9dc"
35963603
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
35973604
"checksum rustfix 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "af7c21531a91512a4a51b490be6ba1c8eff34fdda0dc5bf87dc28d86748aac56"
35983605
"checksum rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9591f190d2852720b679c21f66ad929f9f1d7bb09d1193c26167586029d8489c"

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,3 @@ rustc-std-workspace-core = { path = 'src/tools/rustc-std-workspace-core' }
7070

7171
[patch."https://github.com/rust-lang/rust-clippy"]
7272
clippy_lints = { path = "src/tools/clippy/clippy_lints" }
73-
rustc_tools_util = { path = "src/tools/clippy/rustc_tools_util" }

src/librustc/session/filesearch.rs

-7
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,6 @@ pub fn make_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf {
114114
sysroot.join(&relative_target_lib_path(sysroot, target_triple))
115115
}
116116

117-
pub fn target_lib_path(target_triple: &str) -> PathBuf {
118-
let mut p = PathBuf::from(RUST_LIB_DIR);
119-
p.push(target_triple);
120-
p.push("lib");
121-
p
122-
}
123-
124117
pub fn get_or_default_sysroot() -> PathBuf {
125118
// Follow symlinks. If the resolved path is relative, make it absolute.
126119
fn canonicalize(path: Option<PathBuf>) -> Option<PathBuf> {

src/librustc_driver/lib.rs

+21-19
Original file line numberDiff line numberDiff line change
@@ -269,35 +269,37 @@ fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box<dyn CodegenBackend> {
269269
}
270270

271271
let target = session::config::host_triple();
272-
// get target libdir path based on executable binary path
273-
let sysroot = filesearch::get_or_default_sysroot();
274-
let mut libdir_candidates = vec![filesearch::make_target_lib_path(&sysroot, &target)];
272+
let mut sysroot_candidates = vec![filesearch::get_or_default_sysroot()];
275273
let path = current_dll_path()
276274
.and_then(|s| s.canonicalize().ok());
277275
if let Some(dll) = path {
278-
// use `parent` once to chop off the file name
279-
if let Some(path) = dll.parent() {
276+
// use `parent` twice to chop off the file name and then also the
277+
// directory containing the dll which should be either `lib` or `bin`.
278+
if let Some(path) = dll.parent().and_then(|p| p.parent()) {
280279
// The original `path` pointed at the `rustc_driver` crate's dll.
281280
// Now that dll should only be in one of two locations. The first is
282-
// in the compiler's libdir, for example `$sysroot/$libdir/*.dll`. The
281+
// in the compiler's libdir, for example `$sysroot/lib/*.dll`. The
283282
// other is the target's libdir, for example
284-
// `$sysroot/$libdir/rustlib/$target/lib/*.dll`.
283+
// `$sysroot/lib/rustlib/$target/lib/*.dll`.
285284
//
286285
// We don't know which, so let's assume that if our `path` above
287-
// doesn't end in `$target` we *could* be in the main libdir, and always
288-
// assume that we may be in the target libdir.
289-
libdir_candidates.push(path.to_owned());
290-
291-
if !path.parent().map_or(false, |p| p.ends_with(target)) {
292-
libdir_candidates.push(path.join(filesearch::target_lib_path(target)));
286+
// ends in `$target` we *could* be in the target libdir, and always
287+
// assume that we may be in the main libdir.
288+
sysroot_candidates.push(path.to_owned());
289+
290+
if path.ends_with(target) {
291+
sysroot_candidates.extend(path.parent() // chop off `$target`
292+
.and_then(|p| p.parent()) // chop off `rustlib`
293+
.and_then(|p| p.parent()) // chop off `lib`
294+
.map(|s| s.to_owned()));
293295
}
294296
}
295297
}
296298

297-
let sysroot = libdir_candidates.iter()
298-
.map(|libdir| {
299-
debug!("Trying target libdir: {}", libdir.display());
300-
libdir.with_file_name(
299+
let sysroot = sysroot_candidates.iter()
300+
.map(|sysroot| {
301+
let libdir = filesearch::relative_target_lib_path(&sysroot, &target);
302+
sysroot.join(libdir).with_file_name(
301303
option_env!("CFG_CODEGEN_BACKENDS_DIR").unwrap_or("codegen-backends"))
302304
})
303305
.filter(|f| {
@@ -306,12 +308,12 @@ fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box<dyn CodegenBackend> {
306308
})
307309
.next();
308310
let sysroot = sysroot.unwrap_or_else(|| {
309-
let candidates = libdir_candidates.iter()
311+
let candidates = sysroot_candidates.iter()
310312
.map(|p| p.display().to_string())
311313
.collect::<Vec<_>>()
312314
.join("\n* ");
313315
let err = format!("failed to find a `codegen-backends` folder \
314-
in the libdir candidates:\n* {}", candidates);
316+
in the sysroot candidates:\n* {}", candidates);
315317
early_error(ErrorOutputType::default(), &err);
316318
});
317319
info!("probing {} for a codegen backend", sysroot.display());

src/tools/clippy

src/tools/rls

Submodule rls updated from 6f5e4bb to 1a6361b

0 commit comments

Comments
 (0)