last update: 2017 08 23
index
contact
  1. Linux

    I use Arch Linux (antergos) as operating system.
  2. Install rust

    Download rustup-init from rustup.rs.
    Open a terminal and execute:
    curl https://sh.rustup.rs -sSf | sh
  3. Create a project

    I advise to use cargo to create and build (compile) a Rust project.

    For a program project (with an executable program) execute in the terminal:
    cargo new project_name --bin

    For a library project (with an executable test program) execute in the terminal:
    cargo new project_name

    For the executable file of a program project execute in the terminal:
    cargo build

    For the executable file of a library project execute in the terminal:
    cargo test
  4. Visual Studio Code

    I advise the use of Visual Studio Code to write Rust programs.
    The .tar.gz version of Visual Studio Code works fine on my Arch linux installation.
    Just decompress and launch the /bin/code executable.
  5. Visual Studio Code: Rust (rls)

    Install the Rust (rls) extension.
    Accept to install whatever the extension requests.
    As of 2017 08 23, the local rust installation is updated to nightly.
  6. Visual Studio Code: LLDB Debugger

    Install the LLDB Debugger extension.

    Configuration

    The LLDB Debugger added the main menu item "Debug" from where the debugger can be started.
    When debugging is started for the first time, you must select the environment (the debugger): Select LLDB.
    A launch.json file and a first configuration in that file is created by Visual Studio Code.
    This configuration must be adapted.
    Replace:
    "target": "./bin/executable",
    by:
    "target": "./target/debug/X",
    where X is the name of the executable file in the directory "./target/debug".
    Typically the name of the executable corresponds to the name of the project folder in lower case letters followed by - and a 16 digit hex code.
    No file suffix.
    In my case: fs_2017_08_22-505efa510db4ae1c

    Now you can set breakpoints in the left border of the editor of the source file and start debugging.

    For the executable file of a library project execute in the terminal:
    cargo test