Rust fixme 1

Published: April 2, 2025Updated: December 9, 2025

Description

Fix three small syntax mistakes in a Rust starter project so it compiles and prints the flag.

Extract the archive, `cd fixme1`, and install Rust/Cargo if you don’t already have them.

Run `cargo run` to see the compiler complaints that point directly at the broken lines.

wget https://challenge-files.picoctf.net/c_verbal_sleep/3f0e13f541928f420d9c8c96b06d4dbf7b2fa18b15adbd457108e8c80a1f5883/fixme1.tar.gz
tar -xvf fixme1.tar.gz && cd fixme1
sudo apt install cargo -y
cargo run

Solution

  1. Step 1Add the missing semicolon
    Line 5 ends with a bare expression, so rewrite it as `let x = ...;` to silence the first error.
  2. Step 2Fix the return keyword
    Line 18 uses the shorthand `ret`. Replace it with the full `return` keyword so the function exits cleanly.
  3. Step 3Correct the println! format string
    The final `println!` macro uses `:?` even though it expects `{}`. Swap the placeholder and re-run `cargo run` to print the flag.

Flag

picoCTF{4r3_y0u_4_ru$t4c30n_...}

Follow-up challenges build on the same project. Keep Cargo installed if you plan to tackle Rust Fixme 2 and 3.