Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Centril opened this issue Oct 7, 2018 · 2 comments
Closed

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

Centril opened this issue Oct 7, 2018 · 2 comments

Comments

@Centril
Copy link

Centril commented Oct 7, 2018

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.
@sfackler
Copy link
Member

sfackler commented Oct 7, 2018

I think this has already been implemented:

$ cargo build
   Compiling openssl v0.10.12 (file:///home/sfackler/rust/rust-openssl/openssl)                                                       
    Finished dev [unoptimized + debuginfo] target(s) in 6.58s

@Centril
Copy link
Author

Centril commented Oct 7, 2018

@sfackler Yeah that seems good enough to satisfy the original issue's motivation; closing this as completed.

@Centril Centril closed this as completed Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants