Rust plugin error on elementary OS

I am trying to create a rust snap on elementary OS but get following error,

Downloading 'rustup.sh'[=========================================================================================================================================] 100%
/home/badmatrix/SnapStation/test-rust-snap/test1/parts/my-snap-name/rust/rustup.sh --prefix=/home/badmatrix/SnapStation/test-rust-snap/test1/parts/my-snap-name/rust --disable-sudo --save
info: downloading installer
error: error: Found argument '--prefix' which wasn't expected, or isn't valid in this context

USAGE:
    rustup-init [FLAGS] [OPTIONS]

For more information try --help

Failed to run '/home/badmatrix/SnapStation/test-rust-snap/test1/parts/my-snap-name/rust/rustup.sh --prefix=/home/badmatrix/SnapStation/test-rust-snap/test1/parts/my-snap-name/rust --disable-sudo --save' for 'my-snap-name': Exited with code 1.
Verify that the part is using the correct parameters and try again.

I did not know what causes this error, but, I created the same snap on my other machine(running Ubuntu 20.04) did not cause any error and snap created successfully.

would anyone explain me what is error trying to say? and how to overcome this error?

Can you please paste the snapcraft yaml?

I was setting up my work environment so i am using minimal rust code to create snap.
Here is snapcraft.yaml file that you asked,

name: test-rust # you probably want to 'snapcraft register <name>'
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
base: core18
description: |
  This is my-snap's description. You have a paragraph or two to tell the
  most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots

parts:
  test-rust:
    # See 'snapcraft plugins'
    plugin: rust
    source: .

apps:
  test-rust:
    command: bin/trust
    plugs:
      - home

interesting thing is, when i set pulgin: nil, it build snap without an error.

Are you running Snapcraft with --destructive-mode?

No, just snapcraft command.

what is the output of snapcraft version, snap list snapcraft and which snapcraft?

badmatrix@exellar:~$ snapcraft --version
snapcraft, version 4.8.3

badmatrix@exellar:~$ snap list snapcraft
Name       Version  Rev   Tracking       Publisher   Notes
snapcraft  4.8.3    6596  latest/stable  canonical*  classic
WARNING: There are 4 new warnings. See 'snap warnings'.

badmatrix@exellar:~$ which snapcraft
/snap/bin/snapcraft

Can you share the rust project in source: . or the anatomy of it to verify this is an actual rust project or if a key in Cargo.toml is confusing our plugin?

Seeing this path /home/badmatrix/SnapStation/test-rust-snap leads me to believe you are running on --destructive-mode but if you are using a base and just calling snapcraft I am not sure what it could be. Are you setting any SNAPCRAFT_ environment variables on your system?