Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Make playpen compile with debug asserts/overflow checks per default. #88

Open
Kimundi opened this issue May 12, 2015 · 6 comments
Open

Comments

@Kimundi
Copy link
Member

Kimundi commented May 12, 2015

Eg, so that this panics:

<kimundi> playbot: let x = 5u8; x - 10
-playbot/#rust- 251
@mkpankov
Copy link

I'd rather say there should be another switch - as for optimization (-O0 ... -O2). Makes it easy to identify the current mode and takes no assumptions on what the default is.

Also, allows to argue about features which behave differently in debug and release modes, like @Kimundi 's example :p

@Kimundi
Copy link
Member Author

Kimundi commented May 12, 2015

I just realized that overflow checks are enabled with -O0, so maybe this is unneeded after all - or rather, should playpen maybe default to -O0?

@mkpankov
Copy link

I couldn't trigger compile-time check with -O0: http://imgur.com/zxrZ59z. Besides, optimization levels and debugging capabilities are orthogonal.

@alexcrichton
Copy link
Member

Yeah I've often thought that opt-by-default may be the wrong default here as well, although I think we have two options here:

  • Add a separate toggle for debug assertions
  • Switch to O0 by default

If we add a separate toggle it does seem prudent to enable them by default!

@Kimundi
Copy link
Member Author

Kimundi commented May 13, 2015

@mkpankov: Your screenshot shows a compiletime check though.

However, this issue is about the debug runtime checks.

@mkpankov
Copy link

@Kimundi right, I misunderstood what "application terminated with error code 101" means. Turns out this line is printed on compiler errors and runtime errors the same.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants