]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/context.rs
Rollup merge of #41249 - GuillaumeGomez:rustdoc-render, r=steveklabnik,frewsxcv
[rust.git] / src / librustc / ty / context.rs
index da56514ea82fbf9e485c3f1f761ff9253f9b54cc..8b7438c0bfad2ed5f73efbfece42ffbbd22978d4 100644 (file)
@@ -732,6 +732,11 @@ pub fn create_and_enter<F, R>(s: &'tcx Session,
             ast_ty_to_ty_cache: RefCell::new(NodeMap()),
        }, f)
     }
+
+    pub fn consider_optimizing<T: Fn() -> String>(&self, msg: T) -> bool {
+        let cname = self.crate_name(LOCAL_CRATE).as_str();
+        self.sess.consider_optimizing(&cname, msg)
+    }
 }
 
 impl<'gcx: 'tcx, 'tcx> GlobalCtxt<'gcx> {