Rust cargo test failed in Clion

I get some trouble to run all the tests in my IDE(Clion)

It looks like my cargo setting is incorrect. Is there any way to disable the -Z flag ?

/Users/xxxxx/.cargo/bin/cargo test --color=always --lib scalar_subquery_to_join --no-fail-fast --manifest-path /Users/xxxxx/gitrepo/apache/arrow-datafusion/datafusion/optimizer/Cargo.toml -- --format=json -Z unstable-options --show-output
Testing started at 13:00 ...
Finished test [unoptimized + debuginfo] target(s) in 0.36s
Running unittests src/ (target/debug/deps/datafusion_optimizer-7c3b1a376458cd37)
error: the option Z is only accepted on the nightly compiler
error: test failed, to rerun pass --lib
error: 1 target failed:

If you haven't done that yet you could check the run configuration of your test and see if you accidentaly slipped in a -Z flag.

You can read more on run/debug configurations in the jetbrains documentation.

Are you using the latest version of the rust plugin? Previous versions of rust accidentally accepted -Zunstable-options on stable and the rust plugin for intellij made use of this. With the latest rust release this was made an error as originally intended and as such the rust plugin made a change to stop using this.

1 Like

I'm not sure whether it is related or not, my rust version is 1.70.0.

rustc --version
rustc 1.70.0 (90c541806 2023-05-31)

I just reinstalled the rust plugin in clion but with no luck, the issue is still there.

Do you have or another version of the rust plugin?

My rust plugin version is:

Anyway, after I reset my cargo/rustc version to 1.69.0, the issue is gone.

According to that version is from before the fix. And if I read the version number correctly you will need a newer version of Clion to get the version of the rust plugin with the fix.

1 Like

You are right!!.
After I upgraded my clion and uses the new version of the rust plugin, the issue is gone.
Thanks a lot for the kindly help! Appreciate a lot!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.