]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/lib.rs
Auto merge of #92153 - petrochenkov:foreignchild, r=cjgillot
[rust.git] / src / librustdoc / lib.rs
index 8699ab20b19d4f34873b37a076777cd93bc2753b..95de28e0c5b26cf1d503996e57a9ed67ef278d13 100644 (file)
 extern crate rustc_typeck;
 extern crate test;
 
+// See docs in https://github.com/rust-lang/rust/blob/master/compiler/rustc/src/main.rs
+// about jemalloc.
 #[cfg(feature = "jemalloc")]
 extern crate tikv_jemalloc_sys;
 #[cfg(feature = "jemalloc")]
 use tikv_jemalloc_sys as jemalloc_sys;
-#[cfg(feature = "jemalloc")]
-extern crate tikv_jemallocator;
-#[cfg(feature = "jemalloc")]
-use tikv_jemallocator as jemallocator;
 
 use std::default::Default;
 use std::env;
@@ -125,15 +123,9 @@ macro_rules! map {
 mod visit_ast;
 mod visit_lib;
 
-// See docs in https://github.com/rust-lang/rust/blob/master/compiler/rustc/src/main.rs
-// about jemallocator
-#[cfg(feature = "jemalloc")]
-#[global_allocator]
-static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
-
 pub fn main() {
     // See docs in https://github.com/rust-lang/rust/blob/master/compiler/rustc/src/main.rs
-    // about jemalloc-sys
+    // about jemalloc.
     #[cfg(feature = "jemalloc")]
     {
         use std::os::raw::{c_int, c_void};
@@ -152,10 +144,6 @@ pub fn main() {
         #[used]
         static _F6: unsafe extern "C" fn(*mut c_void) = jemalloc_sys::free;
 
-        // On OSX, jemalloc doesn't directly override malloc/free, but instead
-        // registers itself with the allocator's zone APIs in a ctor. However,
-        // the linker doesn't seem to consider ctors as "used" when statically
-        // linking, so we need to explicitly depend on the function.
         #[cfg(target_os = "macos")]
         {
             extern "C" {
@@ -274,9 +262,6 @@ fn opts() -> Vec<RustcOptGroup> {
         stable("h", |o| o.optflagmulti("h", "help", "show this help message")),
         stable("V", |o| o.optflagmulti("V", "version", "print rustdoc's version")),
         stable("v", |o| o.optflagmulti("v", "verbose", "use verbose output")),
-        stable("r", |o| {
-            o.optopt("r", "input-format", "the input type of the specified file", "[rust]")
-        }),
         stable("w", |o| o.optopt("w", "output-format", "the output type to write", "[html]")),
         stable("output", |o| {
             o.optopt(
@@ -313,21 +298,9 @@ fn opts() -> Vec<RustcOptGroup> {
                 "give precedence to `--extern-html-root-url`, not `html_root_url`",
             )
         }),
-        stable("plugin-path", |o| o.optmulti("", "plugin-path", "removed", "DIR")),
         stable("C", |o| {
             o.optmulti("C", "codegen", "pass a codegen option to rustc", "OPT[=VALUE]")
         }),
-        stable("passes", |o| {
-            o.optmulti(
-                "",
-                "passes",
-                "list of passes to also run, you might want to pass it multiple times; a value of \
-                 `list` will print available passes",
-                "PASSES",
-            )
-        }),
-        stable("plugins", |o| o.optmulti("", "plugins", "removed", "PLUGINS")),
-        stable("no-default", |o| o.optflagmulti("", "no-defaults", "don't run the default passes")),
         stable("document-private-items", |o| {
             o.optflagmulti("", "document-private-items", "document private items")
         }),
@@ -653,6 +626,51 @@ fn opts() -> Vec<RustcOptGroup> {
                 "path to function call information (for displaying examples in the documentation)",
             )
         }),
+        // deprecated / removed options
+        stable("plugin-path", |o| {
+            o.optmulti(
+                "",
+                "plugin-path",
+                "removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
+                for more information",
+                "DIR",
+            )
+        }),
+        stable("passes", |o| {
+            o.optmulti(
+                "",
+                "passes",
+                "removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
+                for more information",
+                "PASSES",
+            )
+        }),
+        stable("plugins", |o| {
+            o.optmulti(
+                "",
+                "plugins",
+                "removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
+                for more information",
+                "PLUGINS",
+            )
+        }),
+        stable("no-default", |o| {
+            o.optflagmulti(
+                "",
+                "no-defaults",
+                "removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
+                for more information",
+            )
+        }),
+        stable("r", |o| {
+            o.optopt(
+                "r",
+                "input-format",
+                "removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
+                for more information",
+                "[rust]",
+            )
+        }),
     ]
 }
 
@@ -761,11 +779,9 @@ fn main_options(options: config::Options) -> MainResult {
     // plug/cleaning passes.
     let crate_version = options.crate_version.clone();
 
-    let default_passes = options.default_passes;
     let output_format = options.output_format;
     // FIXME: fix this clone (especially render_options)
     let externs = options.externs.clone();
-    let manual_passes = options.manual_passes.clone();
     let render_options = options.render_options.clone();
     let scrape_examples_options = options.scrape_examples_options.clone();
     let config = core::create_config(options);
@@ -796,8 +812,7 @@ fn main_options(options: config::Options) -> MainResult {
                     core::run_global_ctxt(
                         tcx,
                         resolver,
-                        default_passes,
-                        manual_passes,
+                        show_coverage,
                         render_options,
                         output_format,
                     )