summaryrefslogtreecommitdiffstats
path: root/src/librustdoc/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/lib.rs')
-rw-r--r--src/librustdoc/lib.rs40
1 files changed, 7 insertions, 33 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 86454e1f2..4fcf08736 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -6,7 +6,6 @@
#![feature(array_methods)]
#![feature(assert_matches)]
#![feature(box_patterns)]
-#![feature(control_flow_enum)]
#![feature(drain_filter)]
#![feature(is_terminal)]
#![feature(let_chains)]
@@ -21,6 +20,7 @@
#![allow(clippy::collapsible_if, clippy::collapsible_else_if)]
#![allow(rustc::potential_query_instability)]
+extern crate thin_vec;
#[macro_use]
extern crate tracing;
@@ -32,6 +32,7 @@ extern crate tracing;
//
// Dependencies listed in Cargo.toml do not need `extern crate`.
+extern crate pulldown_cmark;
extern crate rustc_ast;
extern crate rustc_ast_pretty;
extern crate rustc_attr;
@@ -82,7 +83,6 @@ use rustc_session::getopts;
use rustc_session::{early_error, early_warn};
use crate::clean::utils::DOC_RUST_LANG_ORG_CHANNEL;
-use crate::passes::collect_intra_doc_links;
/// A macro to create a FxHashMap.
///
@@ -742,7 +742,7 @@ fn main_args(at_args: &[String]) -> MainResult {
(false, true) => {
let input = options.input.clone();
let edition = options.edition;
- let config = core::create_config(options);
+ let config = core::create_config(options, &render_options);
// `markdown::render` can invoke `doctest::make_test`, which
// requires session globals and a thread pool, so we use
@@ -775,7 +775,7 @@ fn main_args(at_args: &[String]) -> MainResult {
let scrape_examples_options = options.scrape_examples_options.clone();
let bin_crate = options.bin_crate;
- let config = core::create_config(options);
+ let config = core::create_config(options, &render_options);
interface::run_compiler(config, |compiler| {
let sess = compiler.session();
@@ -793,40 +793,14 @@ fn main_args(at_args: &[String]) -> MainResult {
}
compiler.enter(|queries| {
- // We need to hold on to the complete resolver, so we cause everything to be
- // cloned for the analysis passes to use. Suboptimal, but necessary in the
- // current architecture.
- // FIXME(#83761): Resolver cloning can lead to inconsistencies between data in the
- // two copies because one of the copies can be modified after `TyCtxt` construction.
- let (resolver, resolver_caches) = {
- let expansion = abort_on_err(queries.expansion(), sess);
- let (krate, resolver, _) = &*expansion.borrow();
- let resolver_caches = resolver.borrow_mut().access(|resolver| {
- collect_intra_doc_links::early_resolve_intra_doc_links(
- resolver,
- krate,
- render_options.document_private,
- )
- });
- (resolver.clone(), resolver_caches)
- };
-
+ let mut gcx = abort_on_err(queries.global_ctxt(), sess);
if sess.diagnostic().has_errors_or_lint_errors().is_some() {
sess.fatal("Compilation failed, aborting rustdoc");
}
- let global_ctxt = abort_on_err(queries.global_ctxt(), sess);
-
- global_ctxt.enter(|tcx| {
+ gcx.enter(|tcx| {
let (krate, render_opts, mut cache) = sess.time("run_global_ctxt", || {
- core::run_global_ctxt(
- tcx,
- resolver,
- resolver_caches,
- show_coverage,
- render_options,
- output_format,
- )
+ core::run_global_ctxt(tcx, show_coverage, render_options, output_format)
});
info!("finished with rustc");