est31 / cargo-udeps

Find unused dependencies in Cargo.toml
Other
1.76k stars 46 forks source link

How to add `-Zbuild-std` option? #153

Open paulrouget opened 1 year ago

paulrouget commented 1 year ago

My crate needs -Z … options (-Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem). Anyway to pass that as an option to cargo udeps?

est31 commented 1 year ago

The options that cargo supports should also be supported by cargo-udeps. However, the released version of cargo-udeps is currently 1-2 versions behind the released version of cargo, so if you use newer -Z features they won't work. However, build-std should be present on the older versions of cargo that cargo-udeps uses.

Do you have any issues with just adding the -Z options?

paulrouget commented 1 year ago

I try passing these arguments:

> cargo +nightly udeps -p xxx --target=thumbv4t-none-eabi -Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem
error: Found argument '-Z' which wasn't expected, or isn't valid in this context
Qix- commented 1 year ago

I'm also hitting this. Is there any workaround for this?