]> git.lizzy.rs Git - rust.git/commitdiff
Stop checking uses_std
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Sun, 4 Jun 2017 16:12:47 +0000 (17:12 +0100)
committerMarco Castelluccio <mcastelluccio@mozilla.com>
Sun, 4 Jun 2017 16:12:47 +0000 (17:12 +0100)
src/librustc_metadata/creader.rs

index 5d1462c502ae48f34d57ce2ee7c22a975a78a154..45633e995502dc4f1953c71bdb375b077ae3165a 100644 (file)
@@ -908,27 +908,18 @@ fn inject_sanitizer_runtime(&mut self) {
 
     fn inject_profiler_runtime(&mut self) {
         if self.sess.opts.debugging_opts.profile {
-            let mut uses_std = false;
-            self.cstore.iter_crate_data(|_, data| {
-                if data.name == "std" {
-                    uses_std = true;
-                }
-            });
-
-            if uses_std {
-                info!("loading profiler");
-
-                let symbol = Symbol::intern("profiler_builtins");
-                let dep_kind = DepKind::Implicit;
-                let (_, data) =
-                    self.resolve_crate(&None, symbol, symbol, None, DUMMY_SP,
-                                       PathKind::Crate, dep_kind);
-
-                // Sanity check the loaded crate to ensure it is indeed a profiler runtime
-                if !data.is_profiler_runtime(&self.sess.dep_graph) {
-                    self.sess.err(&format!("the crate `profiler_builtins` is not \
-                                            a profiler runtime"));
-                }
+            info!("loading profiler");
+
+            let symbol = Symbol::intern("profiler_builtins");
+            let dep_kind = DepKind::Implicit;
+            let (_, data) =
+                self.resolve_crate(&None, symbol, symbol, None, DUMMY_SP,
+                                   PathKind::Crate, dep_kind);
+
+            // Sanity check the loaded crate to ensure it is indeed a profiler runtime
+            if !data.is_profiler_runtime(&self.sess.dep_graph) {
+                self.sess.err(&format!("the crate `profiler_builtins` is not \
+                                        a profiler runtime"));
             }
         }
     }