Error In Rust Smart Canister Deploy [failed: error: Found argument '--message-format' which wasn't expected, or isn't valid in this context]

Hey i have been getting this error , i am using Ubuntu WSL2 , my project is in WSL filesystem and my rustup toolchain version is 1.46.0 . But when i run dfx deploy i get

Caused by: Failed while trying to deploy canisters.
  Failed to build call canisters.
    Failed while trying to build all canisters.
      Failed while trying to build all canisters in the canister pool.
        The pre-build all step failed with an embedded error: Failed step_prebuild_all.: 'cargo locate-project' failed: error: Found argument '--message-format' which wasn't expected, or isn't valid in this context

USAGE:
    cargo locate-project [OPTIONS]

For more information try --help

This is a Rust issue. Most likely your toolchain version is too old for the default dfx deploy. You could either bump your Rust version, or use a custom canister where you set up your own build script

Hey i got it working , actually the rust docs in Internet Computer Loading , was miss leading , because in Before you begin section ,point 2 it said The Rust tool chain must be at version 1.46.0, or later. , i think you guys should change or update that . because the latest stable toolchain worked fine . while i was beating my head to make it work with a 1.46.0 version of it.

Fixing. Thank you for pointing it out and apologies for the misleading info :frowning_face: