Skip to content

Commit e2ab98d

Browse files
committed
Stop using old version of syn in rustc-workspace-hack
None of the tools seem to need syn 0.15.35, so we can just build syn 1.0. This was causing an issue with clippy's `compile-test` program: since multiple versions of `syn` would exist in the build directory, we would non-deterministically pick one based on filesystem iteration order. If the pre-1.0 version of `syn` was picked, a strange build error would occur (see #73594 (comment)) To prevent this kind of issue from happening again, we now panic if we find multiple versions of a crate in the build directly, instead of silently picking the first version we find.
1 parent d3feb8b commit e2ab98d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -3532,7 +3532,6 @@ dependencies = [
35323532
"serde_json",
35333533
"smallvec 0.6.10",
35343534
"smallvec 1.4.0",
3535-
"syn 0.15.35",
35363535
"syn 1.0.11",
35373536
"url 2.1.0",
35383537
"winapi 0.3.8",

src/tools/clippy/tests/compile-test.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ fn third_party_crates() -> String {
4949
if let Some(name) = path.file_name().and_then(OsStr::to_str) {
5050
for dep in CRATES {
5151
if name.starts_with(&format!("lib{}-", dep)) && name.ends_with(".rlib") {
52-
crates.entry(dep).or_insert(path);
52+
if let Some(old) = crates.insert(dep, path.clone()) {
53+
panic!("Found multiple rlibs for crate `{}`: `{:?}` and `{:?}", dep, old, path);
54+
}
5355
break;
5456
}
5557
}

src/tools/rustc-workspace-hack/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ serde = { version = "1.0.82", features = ['derive'] }
6969
serde_json = { version = "1.0.31", features = ["raw_value"] }
7070
smallvec-0_6 = { package = "smallvec", version = "0.6", features = ['union', 'may_dangle'] }
7171
smallvec = { version = "1.0", features = ['union', 'may_dangle'] }
72-
syn = { version = "0.15", features = ['full', 'extra-traits'] }
73-
syn-1 = { package = "syn", version = "1", features = ['fold', 'full', 'extra-traits', 'visit'] }
72+
syn = { version = "1", features = ['fold', 'full', 'extra-traits', 'visit'] }
7473
url = { version = "2.0", features = ['serde'] }
7574

7675
[target.'cfg(not(windows))'.dependencies]

0 commit comments

Comments
 (0)