Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd a macro for "unreachable" whose meaning differs in debug and release builds #18152
Comments
kmcallister
added
E-easy
A-codegen
A-libs
labels
Oct 19, 2014
This comment has been minimized.
This comment has been minimized.
|
OTOH, if |
This comment has been minimized.
This comment has been minimized.
smaudet
commented
Jan 8, 2015
|
Anyone mind if I take a look at this? |
This comment has been minimized.
This comment has been minimized.
|
Perhaps it should be |
This comment has been minimized.
This comment has been minimized.
|
This doesn't require an RFC? @kmcallister edit: @smaudet I'm having a look at it if that's alright by you??? |
vojtechkral
added a commit
to vojtechkral/rust
that referenced
this issue
Jan 12, 2015
vojtechkral
referenced this issue
Jan 12, 2015
Closed
Add a macro named optimize_unreachable!() #21009
kmcallister
added
the
A-macros
label
Jan 16, 2015
This comment has been minimized.
This comment has been minimized.
|
I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized. This issue has been moved to the RFCs repo: rust-lang/rfcs#698 |
kmcallister commentedOct 19, 2014
In debug builds it means "I think we can't get here, please
fail!()if we do", i.e. the same as the currentunreachable!().In release builds it means "I promise we can't get here, LLVM, you are free to do absolutely anything if we can", i.e.
intrinsics::unreachable().Improper use can totally break memory safety in release builds, so we should make it
unsafe-only even in debug builds. For the same reason I don't think the currentunreachable!()should change meaning to this. I don't have a great alternative name, which I think is the main obstacle with this ticket!E-easy E-bikeshed :)