From bdff0dd004686effd8a1a1db256af178677df118 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jeremy@system76.com>
Date: Tue, 26 Sep 2017 13:57:16 -0600
Subject: [PATCH] Fix documentation

---
 Cargo.toml             | 1 +
 src/lib.rs             | 2 ++
 src/panic.rs           | 2 --
 src/syscall/process.rs | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 7771ee6d..9136ca63 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,5 +26,6 @@ default-features = false
 
 [features]
 default = []
+doc = []
 live = []
 multi_core = []
diff --git a/src/lib.rs b/src/lib.rs
index d0a1a225..6f7376b9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -61,6 +61,7 @@ pub mod context;
 pub mod devices;
 
 /// ELF file parsing
+#[cfg(not(feature="doc"))]
 pub mod elf;
 
 /// External functions
@@ -70,6 +71,7 @@ pub mod externs;
 pub mod memory;
 
 /// Panic
+#[cfg(not(any(feature="doc", test)))]
 pub mod panic;
 
 /// Schemes, filesystem handlers
diff --git a/src/panic.rs b/src/panic.rs
index 8ec88a85..a04cf8f6 100644
--- a/src/panic.rs
+++ b/src/panic.rs
@@ -2,11 +2,9 @@
 
 use interrupt;
 
-#[cfg(not(test))]
 #[lang = "eh_personality"]
 pub extern "C" fn eh_personality() {}
 
-#[cfg(not(test))]
 /// Required to handle panics
 #[lang = "panic_fmt"]
 #[no_mangle]
diff --git a/src/syscall/process.rs b/src/syscall/process.rs
index 4c624911..8a56b24f 100644
--- a/src/syscall/process.rs
+++ b/src/syscall/process.rs
@@ -15,6 +15,7 @@ use interrupt;
 use context;
 use context::ContextId;
 use context::file::FileDescriptor;
+#[cfg(not(feature="doc"))]
 use elf::{self, program_header};
 use scheme::FileHandle;
 use syscall;
-- 
GitLab