Skip to content

cargo/rustc should notify users when optimizations are disabled  #6152

Closed
@Centril

Description

@Centril

Refiling rust-lang/rfcs#777 as it seems more appropriate here.

As the Rust community gets more developers coming from JIT'ed or interpreted languages like Java, Python, Ruby, etc., we are going to see more problems where they assume rustc my_file.rs will give fast results even though optimizations are off by default. This can be seen in several threads on Stack Overflow and other forums, including Rust's own (http://users.rust-lang.org/t/reading-numbers-from-a-file/171).

I suggest that when no optimization flags are enabled, rustc should print out a message similar to the following:

rustc my_file.rs
Note: Optimizations are disabled (debug mode). Turn them on by passing the -O flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions