arrow_back 返回

「教程」配置开发Rust调试Debug环境

最后更新于

你将学到什么

安装c++环境

安装rust工具链

在vscode上开发rust

配置launch项

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "preLaunchTask": "build",
            "name": "Debug",
            "program": "${workspaceFolder}/target/debug/${fileBasenameNoExtension}.exe", 
            "args": [],
            "cwd": "${workspaceFolder}"
        }
    ]
}

配置task

{ 
    "version": "2.0.0", 
    "tasks": [
      {
        "label": "build",
        "type": "shell",
        "command": "cargo build",
        "args": [],
        "group": {
          "kind": "build",
          "isDefault": true
        }
      }
    ]
}

配置Cargo.toml

[[bin]]
name = "your script name"
path = "path/to/your/entry.rs"

使用