Skip to content

Your first program

  1. Create the project: toolbar Nuevo (New) → Aplicación de consola (console app). Give it a name, for example greeting. Raxorin Studio creates it and opens src/main.rs.

  2. Write the code:

    src/main.rs
    use std::io;
    fn main() {
    println!("What's your name?");
    let mut name = String::new();
    io::stdin().read_line(&mut name).expect("couldn't read");
    println!("Hello, {}!", name.trim());
    }

    rust-analyzer suggests names as you type and underlines errors instantly.

  3. Run it with Sin depurar (run without debugging, Ctrl/⌘+F5). The Salida (Output) panel shows the build and then your program; type your name in the Entrada (Input) field.

Errors appear in the Lista de errores (Error List); click one to jump to the line, and try Ctrl/⌘+. for quick fixes.