Bug report: Rust code is being compiled in debug mode without optimization

Rust code is being compiled in debug mode, which is much slower than release mode. You can verify this in the IDE with a Rust program like

fn main() {
    #[cfg(debug_assertions)]
    println!("debug mode");

    #[cfg(not(debug_assertions))]
    println!("release mode");
}

which in release mode should output

release mode

but in debug mode actually outputs

debug mode

This observation contradicts the FAQ which claims that Rust code is compiled with -O, and explains my mysterious TLE results in Rust submissions.

Can you please fix the judge to actually compile Rust code with rustc -O?

While you’re looking at this, 1.14.0 is a really ancient version of Rust, and it’d be nice to have a modern version supporting Rust 2018 (rustc -O --edition=2018).

3 Likes