From f0e45bfe810fde06625ef71bd9bb3b51e3ebd745 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Thu, 4 Jul 2019 20:20:14 -0500 Subject: [PATCH] fix macos build --- src/tools/rustbook/src/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index 668ee1edf3697..a9f8167c5acfe 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -12,6 +12,8 @@ use mdbook_1::errors::{Result as Result1}; use mdbook::MDBook; use mdbook::errors::{Result as Result3}; + +#[cfg(all(target_arch = "x86_64", target_os = "linux"))] use mdbook::renderer::RenderContext; #[cfg(all(target_arch = "x86_64", target_os = "linux"))] @@ -79,9 +81,12 @@ fn main() { if let Err(err) = linkcheck(sub_matches) { eprintln!("Error: {}", err); - if let Ok(broken_links) = err.downcast::() { - for cause in broken_links.links().iter() { - eprintln!("\tCaused By: {}", cause); + #[cfg(all(target_arch = "x86_64", target_os = "linux"))] + { + if let Ok(broken_links) = err.downcast::() { + for cause in broken_links.links().iter() { + eprintln!("\tCaused By: {}", cause); + } } }