about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-10-05 07:17:09 +0000
committerbors <bors@rust-lang.org>2014-10-05 07:17:09 +0000
commit5660db2508159513e0ade032ae9349977e7371b5 (patch)
tree2a873cd9ebba0cd0ea61745ae4e08f35fb98cd1f /src/libcore
parent3b8c528d083b2e1f6b34eceb518d60c5efdb4ef4 (diff)
parent675aa7692dd1b75e63b11cd991be5efddbdb2acd (diff)
downloadrust-5660db2508159513e0ade032ae9349977e7371b5.tar.gz
rust-5660db2508159513e0ade032ae9349977e7371b5.zip
auto merge of #16970 : kmcallister/rust/llvm-unreachable, r=thestinger
I'm not sure how to add an automated test for this.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/intrinsics.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index a3d63bbe06c..7d86b65168f 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -250,6 +250,13 @@ extern "rust-intrinsic" {
     /// Abort the execution of the process.
     pub fn abort() -> !;
 
+    /// Tell LLVM that this point in the code is not reachable,
+    /// enabling further optimizations.
+    ///
+    /// NB: This is very different from the `unreachable!()` macro!
+    #[cfg(not(stage0))]
+    pub fn unreachable() -> !;
+
     /// Execute a breakpoint trap, for inspection by a debugger.
     pub fn breakpoint();