2

I am new to Rust and I am using CLion and the Rust plugin from JetBrains on Windows now. It works well when I just compile and run. But when I start debugging, it shows a dialog like this even though I switch my toolchain to WSL.

screenshot of WSL toolchain settings

screenshot of the error dialog

I wonder whether WSL is a kind of GNU toolchain. And if it is, what should I do to enable Rust debugging?

Pang
  • 9,564
  • 146
  • 81
  • 122
theodore
  • 41
  • 1
  • 6

1 Answers1

5

Rust provides two kinds of Tier 1 toolchains for the Windows operating system: pc-windows-msvc and pc-windows-gnu (for i686 and x864_64 architectures, making 4 toolchains in total). Their differences are highlighted here: What are the differences between the GNU and MSVC Rust toolchain?

WSL requires you to use the GNU toolchain. With Rustup, you can install it and make it the default (or configure it in your IDE of choice):

rustup toolchain add stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu
E_net4
  • 27,810
  • 13
  • 101
  • 139
  • 1
    `rustup default` implies `rustup toolchain add`, so the first line can be omitted. – Tim Diekmann Dec 11 '18 at 14:05
  • @TimDiekmann That's because the latest Rustup automatically installs missing toolchains on some commands, including `rustup default` and `rustup override set`. Given that setting the default toolchain across the system might not always be desired, I chose to separate the two. – E_net4 Dec 11 '18 at 14:08
  • Thank you! I previously thought the toolchain is what about the CLion toolchain. I've mixed them up. – theodore Dec 12 '18 at 02:53