From 27239e1123303129bb48d976e71bb79aad3fa5e3 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sun, 15 Oct 2017 01:04:12 +0200 Subject: Make usage of core_intrinsics optional --- components/script/task.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'components/script/task.rs') diff --git a/components/script/task.rs b/components/script/task.rs index e90fc21c55c..eab786c8c20 100644 --- a/components/script/task.rs +++ b/components/script/task.rs @@ -5,7 +5,6 @@ //! Machinery for [tasks](https://html.spec.whatwg.org/multipage/#concept-task). use std::fmt; -use std::intrinsics; use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; @@ -33,7 +32,10 @@ macro_rules! task { pub trait TaskOnce: Send { #[allow(unsafe_code)] fn name(&self) -> &'static str { - unsafe { intrinsics::type_name::() } + #[cfg(feature = "unstable")] + unsafe { ::std::intrinsics::type_name::() } + #[cfg(not(feature = "unstable"))] + { "(task name unknown)" } } fn run_once(self); -- cgit v1.2.3