diff --git a/kani-driver/src/call_cargo.rs b/kani-driver/src/call_cargo.rs index 6bd6a0c35f38..eab035eab382 100644 --- a/kani-driver/src/call_cargo.rs +++ b/kani-driver/src/call_cargo.rs @@ -320,7 +320,11 @@ fn packages_to_verify<'b>( .collect() } else if !args.cargo.exclude.is_empty() { validate_package_names(&args.cargo.exclude, &metadata.packages)?; - metadata.packages.iter().filter(|pkg| !args.cargo.exclude.contains(&pkg.name)).collect() + metadata + .workspace_packages() + .into_iter() + .filter(|pkg| !args.cargo.exclude.contains(&pkg.name)) + .collect() } else { match (args.cargo.workspace, metadata.root_package()) { (true, _) | (_, None) => metadata.workspace_packages(),