Rust compiler-explorer produce error with -g or no output with -O
See original GitHub issueWhen I use the below valid code written in Rust, I see assembly generated - it’s all good. I use the default GUI options of compiler-explorer
and no compiler options. However, if I use the compiler option:
-g
, the result is<Compilation failed>
.-O
, the result is 7 empty lines.
In both cases, I expect to see assembly code.
fn main() {
let mut sum: u32 = 0;
let (from, to) = (0, 500);
for i in from..to {
sum += i;
}
println!("{}", sum) // 124750
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Rust compiler-explorer produce error with -g or no output with -O
I use the default GUI options of compiler-explorer and no compiler options. However, if I use the compiler option: -g , the result...
Read more >Rust @godbolt - Compiler Explorer
Compiler Explorer is an interactive online compiler which shows the assembly output of compiled C++, Rust, Go (and many more) code.
Read more >Why doesn't the Godbolt compiler explorer show any output ...
When I compile in release mode by passing -O to the compiler, there is no output at all! What am I doing wrong?...
Read more >Optimizations in C++ Compilers - ACM Queue
The golden rule for helping the compiler optimize is to ensure it has as much information as possible to make the right optimization...
Read more >Compiler... hanging? - help
Hey, I'm fairly new to rust, but using Advent of Code to go deeper into the language. I wrote this solution to today's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree. To save place on screen, these hard coded options required for compiler-explorer could be toggled between a “…” and the hidden options.
An ASCII drawing of the compiler and its options. Default view will hide the required options. Example with rust:
If I clic on “…”, the compiler bar would become for example a read only text showing hidden options:
Tell me if my ASCII drawings are not clear enough.
It’s not quite what you wanted but if you click on the compilation results indicator (between the compiler selection dropdown and the flags) you see all the options we pass. I hope this is good enough: If you feel strongly that this doesn’t quite cover your idea then please reply and we’ll consider alternatives. Thanks!