Search code examples
visual-studio-coderustvscode-debugger

Debug Rust binary built in nightly mode


I would like to debug my rust source code by clicking on "Debug" in the UI (see screenshot). I need to enable the nightly flag for my code to work. How can I update the default debug configuration to pass the nightly flag? To make things more complex, I'm connected to a remote box via SSH.

Screenshot


Solution

  • You can use the standard mechanisms to specify nightly using a toolchain override. If your code should always use nightly, your best bet is to either:

    • set a override via rustup override set nightly in your project's directory
    • create a rust-toolchain.toml file with [toolchain] channel = "nightly"

    That way all Cargo commands in your project will use it.