public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust] rawhide: Allow unused dependencies reported by Cargo 1.100
@ 2026-11-20 17:25 Josh Stone
  0 siblings, 0 replies; only message in thread
From: Josh Stone @ 2026-11-20 17:25 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rust
Branch : rawhide
Commit : 91d93208eeb8bc3247882703a3ebdfa874c27e73
Author : Josh Stone <jistone@redhat.com>
Date   : 2026-11-19T13:50:00-08:00
Stats  : +197/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rust/c/91d93208eeb8bc3247882703a3ebdfa874c27e73?branch=rawhide

Log:
Allow unused dependencies reported by Cargo 1.100

---
diff --git a/0001-adjust-for-new-Cargo-lints.patch b/0001-adjust-for-new-Cargo-lints.patch
new file mode 100644
index 0000000..73500b0
--- /dev/null
+++ b/0001-adjust-for-new-Cargo-lints.patch
@@ -0,0 +1,192 @@
+From dc82ffa48af0a900b19e7baed2b59f5822440434 Mon Sep 17 00:00:00 2001
+From: Mark Rousskov <mark.simulacrum@gmail.com>
+Date: Tue, 29 Sep 2026 08:13:20 -0400
+Subject: [PATCH] adjust for new Cargo lints
+
+(cherry picked from commit daa24324904fa6aa460a22de733068c8dcb0323d)
+---
+ compiler/rustc/src/main.rs                                   | 2 +-
+ library/alloc/Cargo.toml                                     | 4 ++++
+ library/panic_unwind/Cargo.toml                              | 3 +++
+ library/std/Cargo.toml                                       | 4 ++++
+ library/std_detect/Cargo.toml                                | 4 ++++
+ library/sysroot/Cargo.toml                                   | 5 +++++
+ src/tools/clippy/clippy_test_deps/Cargo.toml                 | 4 ++++
+ src/tools/miri/tests/deps/Cargo.toml                         | 4 ++++
+ src/tools/miri/tests/deps/cross-crate-items/Cargo.toml       | 4 ++++
+ src/tools/rust-analyzer/Cargo.toml                           | 5 +++--
+ src/tools/rust-analyzer/crates/macros/Cargo.toml             | 3 +++
+ .../crates/proc-macro-srv/proc-macro-test/Cargo.toml         | 3 +++
+ .../rust-analyzer/lib/ungrammar/ungrammar2json/Cargo.toml    | 3 +++
+ 13 files changed, 45 insertions(+), 3 deletions(-)
+
+diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs
+index 17f768f6dc54..2d725e750c5d 100644
+--- a/compiler/rustc/src/main.rs
++++ b/compiler/rustc/src/main.rs
+@@ -1,7 +1,7 @@
+ // We need this feature as it changes `dylib` linking behavior and allows us to link to `rustc_driver`.
+ #![feature(rustc_private)]
+ // Several crates are depended upon but unused so that they are present in the sysroot
+-#![expect(unused_crate_dependencies)]
++#![allow(unused_crate_dependencies)]
+ 
+ use std::process::ExitCode;
+ 
+diff --git a/library/alloc/Cargo.toml b/library/alloc/Cargo.toml
+index b32e5e991cc7..a1071d2cde5f 100644
+--- a/library/alloc/Cargo.toml
++++ b/library/alloc/Cargo.toml
+@@ -31,3 +31,7 @@ check-cfg = [
+     'cfg(no_rc)',
+     'cfg(no_sync)',
+ ]
++
++[lints.cargo]
++# compiler-builtins is claimed unused?
++unused_dependencies = "allow"
+diff --git a/library/panic_unwind/Cargo.toml b/library/panic_unwind/Cargo.toml
+index 72c1041b4679..3b7805a20549 100644
+--- a/library/panic_unwind/Cargo.toml
++++ b/library/panic_unwind/Cargo.toml
+@@ -18,3 +18,6 @@ unwind = { path = "../unwind" }
+ 
+ [target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
+ libc = { version = "0.2", default-features = false }
++
++[lints.cargo]
++unused_dependencies = "allow"
+diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml
+index 1d35b42a5394..67eebd820ca5 100644
+--- a/library/std/Cargo.toml
++++ b/library/std/Cargo.toml
+@@ -167,3 +167,7 @@ check-cfg = [
+     'cfg(target_has_reliable_f128)',
+     'cfg(target_has_reliable_f128_math)',
+ ]
++
++[lints.cargo]
++# panic_abort is not directly used but must be linked in
++unused_dependencies = "allow"
+diff --git a/library/std_detect/Cargo.toml b/library/std_detect/Cargo.toml
+index a6785bb20555..c03fff827d5c 100644
+--- a/library/std_detect/Cargo.toml
++++ b/library/std_detect/Cargo.toml
+@@ -24,3 +24,7 @@ libc = { version = "0.2.0", default-features = false }
+ 
+ [features]
+ std_detect_env_override = []
++
++[lints.cargo]
++# libc is definitely used in code but the lint doesn't realize that (unclear why)
++unused_dependencies = "allow"
+diff --git a/library/sysroot/Cargo.toml b/library/sysroot/Cargo.toml
+index 10562389d62d..cef5532857b5 100644
+--- a/library/sysroot/Cargo.toml
++++ b/library/sysroot/Cargo.toml
+@@ -32,3 +32,8 @@ optimize_for_size = ["std/optimize_for_size"]
+ panic-unwind = ["std/panic-unwind"]
+ profiler = ["dep:profiler_builtins"]
+ windows_raw_dylib = ["std/windows_raw_dylib"]
++
++[lints.cargo]
++# We expect some of these dependencies to not actually be used since this is
++# just an aggregator crate.
++unused_dependencies = "allow"
+diff --git a/src/tools/clippy/clippy_test_deps/Cargo.toml b/src/tools/clippy/clippy_test_deps/Cargo.toml
+index 880df6599c1e..c3d236a17e1b 100644
+--- a/src/tools/clippy/clippy_test_deps/Cargo.toml
++++ b/src/tools/clippy/clippy_test_deps/Cargo.toml
+@@ -18,3 +18,7 @@ itertools = "0.15"
+ 
+ # Make sure we are not part of the rustc workspace.
+ [workspace]
++
++[lints.cargo]
++# Not all tests use all of the above dependencies
++unused_dependencies = "allow"
+diff --git a/src/tools/miri/tests/deps/Cargo.toml b/src/tools/miri/tests/deps/Cargo.toml
+index a377141f98aa..6b6d4a9e2f44 100644
+--- a/src/tools/miri/tests/deps/Cargo.toml
++++ b/src/tools/miri/tests/deps/Cargo.toml
+@@ -37,3 +37,7 @@ windows-sys = { version = "0.61", features = [
+ # Make sure we are not part of the rustc workspace.
+ [workspace]
+ members = ["cross-crate-items"]
++
++[lints.cargo]
++# Not all tests use all of the above dependencies
++unused_dependencies = "allow"
+diff --git a/src/tools/miri/tests/deps/cross-crate-items/Cargo.toml b/src/tools/miri/tests/deps/cross-crate-items/Cargo.toml
+index 1f9fc93cd523..ca6818dc0fe2 100644
+--- a/src/tools/miri/tests/deps/cross-crate-items/Cargo.toml
++++ b/src/tools/miri/tests/deps/cross-crate-items/Cargo.toml
+@@ -5,3 +5,7 @@ edition = "2021"
+ 
+ [dependencies]
+ futures = { version = "0.3.0", default-features = false, features = ["alloc", "async-await"] }
++
++[lints.cargo]
++# panic_abort is not directly used but must be linked in
++unused_dependencies = "allow"
+diff --git a/src/tools/rust-analyzer/Cargo.toml b/src/tools/rust-analyzer/Cargo.toml
+index d77e89df45e4..54e82148665b 100644
+--- a/src/tools/rust-analyzer/Cargo.toml
++++ b/src/tools/rust-analyzer/Cargo.toml
+@@ -68,10 +68,8 @@ parser = { path = "./crates/parser", version = "0.0.0" }
+ paths = { path = "./crates/paths", version = "0.0.0" }
+ proc-macro-api = { path = "./crates/proc-macro-api", version = "0.0.0" }
+ proc-macro-srv = { path = "./crates/proc-macro-srv", version = "0.0.0" }
+-proc-macro-srv-cli = { path = "./crates/proc-macro-srv-cli", version = "0.0.0" }
+ profile = { path = "./crates/profile", version = "0.0.0" }
+ project-model = { path = "./crates/project-model", version = "0.0.0" }
+-query-group = { package = "query-group-macro", path = "./crates/query-group-macro", version = "0.0.0" }
+ span = { path = "./crates/span", version = "0.0.0" }
+ stdx = { path = "./crates/stdx", version = "0.0.0" }
+ syntax = { path = "./crates/syntax", version = "0.0.0" }
+@@ -167,6 +165,9 @@ hashbrown = { version = "0.17.0", features = [
+ # We need to freeze the version of the crate, as the raw-api feature is considered unstable
+ dashmap = { version = "=6.2.1", features = ["raw-api", "inline"] }
+ 
++[workspace.lints.cargo]
++unused_dependencies = "allow"
++
+ [workspace.lints.rust]
+ # remember to update RUSTFLAGS in ci.yml if you add something here
+ 
+diff --git a/src/tools/rust-analyzer/crates/macros/Cargo.toml b/src/tools/rust-analyzer/crates/macros/Cargo.toml
+index 8184cc6d1c03..b0d000026858 100644
+--- a/src/tools/rust-analyzer/crates/macros/Cargo.toml
++++ b/src/tools/rust-analyzer/crates/macros/Cargo.toml
+@@ -17,3 +17,6 @@ proc-macro2 = "1"
+ quote = "1"
+ syn = "2.0.9"
+ synstructure = "0.13.0"
++
++[lints]
++workspace = true
+diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/proc-macro-test/Cargo.toml b/src/tools/rust-analyzer/crates/proc-macro-srv/proc-macro-test/Cargo.toml
+index 78630ddb4d7d..668188340e5c 100644
+--- a/src/tools/rust-analyzer/crates/proc-macro-srv/proc-macro-test/Cargo.toml
++++ b/src/tools/rust-analyzer/crates/proc-macro-srv/proc-macro-test/Cargo.toml
+@@ -11,3 +11,6 @@ doctest = false
+ 
+ [build-dependencies]
+ cargo_metadata = "0.23.0"
++
++[lints]
++workspace = true
+diff --git a/src/tools/rust-analyzer/lib/ungrammar/ungrammar2json/Cargo.toml b/src/tools/rust-analyzer/lib/ungrammar/ungrammar2json/Cargo.toml
+index 0fa08bbbd048..f17587e3f556 100644
+--- a/src/tools/rust-analyzer/lib/ungrammar/ungrammar2json/Cargo.toml
++++ b/src/tools/rust-analyzer/lib/ungrammar/ungrammar2json/Cargo.toml
+@@ -10,3 +10,6 @@ edition = "2024"
+ [dependencies]
+ write-json = "0.1.1"
+ ungrammar = { path = "../", version = "1.1.0" }
++
++[lints]
++workspace = true
+-- 
+2.56.0
+

diff --git a/rust.spec b/rust.spec
index 2b06fab..4337e5b 100644
--- a/rust.spec
+++ b/rust.spec
@@ -161,6 +161,10 @@ Patch8:         0001-Enable-SHSTK-by-default-on-x86_64-unknown-linux-gnu.patch
 # Ensure llvm worker threads have sufficient stack space. Backport of #163289.
 Patch9:         0001-Ensure-llvm-worker-threads-have-sufficient-stack-spa.patch
 
+# Allow unused dependencies reported by Cargo 1.100 (as stage0)
+# https://github.com/rust-lang/rust/pull/163483/changes/daa24324904fa6aa460a22de733068c8dcb0323d
+Patch10:        0001-adjust-for-new-Cargo-lints.patch
+
 ### RHEL-specific patches below ###
 
 # Simple rpm macros for rust-toolset (as opposed to full rust-packaging)
@@ -744,6 +748,7 @@ test "$(cut -d' ' -f1 ./version)" = "%{lua: print((rpm.expand('%version'):gsub('
 %patch -P7 -p1
 %patch -P8 -p1
 %patch -P9 -p1
+%patch -P10 -p1
 
 %if %with disabled_libssh2
 %patch -P100 -p1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-20 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 17:25 [rpms/rust] rawhide: Allow unused dependencies reported by Cargo 1.100 Josh Stone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox