diff --git a/Cargo.lock b/Cargo.lock index 1422df4b05959..7b650cec7e9ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3862,14 +3862,14 @@ dependencies = [ [[package]] name = "foundry-compilers" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7235826f00dd9196bcbdbb9c168ea38235601db95883a78819ba2303dee34bb8" +checksum = "d817beee8c566a99f4267f25ff63d0de46c442948496ecef91ead56e3383090c" dependencies = [ "alloy-json-abi", "alloy-primitives", "auto_impl", - "derivative", + "derive_more", "dirs 5.0.1", "dyn-clone", "foundry-compilers-artifacts", @@ -3899,9 +3899,9 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "097bc5db7be5acf6d92938ad7daabf1932d7aa7c44326cdfc256531a53034d31" +checksum = "bec784a3a809ba2ee723fcfeb737a6ac90b4fd1e4d048c2d49fed6723bd35547" dependencies = [ "foundry-compilers-artifacts-solc", "foundry-compilers-artifacts-vyper", @@ -3909,9 +3909,9 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-solc" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4168053c1ad217866c677a074517e8d51988e5b1bad044b95f3c513aa5b6caa" +checksum = "44549c33e5a03408c8d40c36d764b7e84d261258ef481c19e4a612e609fdf8a4" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -3933,9 +3933,9 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-vyper" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b7beffe7182551d01d249f022a5eab17c36c73b39ae8efd404e0fb9c98b9f80" +checksum = "a438605ae74689752b2f717165daac15766f1b2a166d2095715d5f9407084b52" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -3948,9 +3948,9 @@ dependencies = [ [[package]] name = "foundry-compilers-core" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5247875b96dfb99da12d0cd0f6ce98954116d1cf8a9188d613b2a35cd6937b" +checksum = "04ac6d85c3e2d12585f8e698b12ed4880b02716ec7fde5d62de9a194e62f4e36" dependencies = [ "alloy-primitives", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 68414b68384e3..b8b0cfbebd008 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -169,7 +169,7 @@ foundry-linking = { path = "crates/linking" } # solc & compilation utilities foundry-block-explorers = { version = "0.9.0", default-features = false } -foundry-compilers = { version = "0.12.7", default-features = false } +foundry-compilers = { version = "0.12.8", default-features = false } foundry-fork-db = "0.9.0" solang-parser = "=0.3.3" solar-ast = { version = "=0.1.0", default-features = false } diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index 805aaf7cd1634..7264b63f88b03 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -949,6 +949,7 @@ impl Config { } /// Resolves globs and builds a mapping from individual source files to their restrictions + #[expect(clippy::disallowed_macros)] fn restrictions( &self, paths: &ProjectPathsConfig, @@ -977,7 +978,20 @@ impl Config { if !map.contains_key(source) { map.insert(source.clone(), res); } else { - map.get_mut(source.as_path()).unwrap().merge(res); + let value = map.remove(source.as_path()).unwrap(); + if let Some(merged) = value.clone().merge(res) { + map.insert(source.clone(), merged); + } else { + // `sh_warn!` is a circular dependency, preventing us from using it here. + eprintln!( + "{}", + yansi::Paint::yellow(&format!( + "Failed to merge compilation restrictions for {}", + source.display() + )) + ); + map.insert(source.clone(), value); + } } } }