about summary refs log tree commit diff
path: root/src/librustdoc/lib.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-02-01 20:30:32 +0800
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2023-02-10 09:34:13 +0400
commitb62b82aef4b6aa667161c664fc3ae738c2fc6b9f (patch)
tree8810a1d178702e82c4e1a783d52e3515246ea78a /src/librustdoc/lib.rs
parenta12d31d5a681d70f277b4fbf6cafe22bae876ea7 (diff)
downloadrust-b62b82aef4b6aa667161c664fc3ae738c2fc6b9f.tar.gz
rust-b62b82aef4b6aa667161c664fc3ae738c2fc6b9f.zip
Resolve documentation links in rustc and store the results in metadata
This commit implements MCP https://github.com/rust-lang/compiler-team/issues/584

It also removes code that is no longer used, and that includes code cloning resolver, so issue #83761 is fixed.
Diffstat (limited to 'src/librustdoc/lib.rs')
-rw-r--r--src/librustdoc/lib.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 64108c88285..0d4a87eb4fe 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -31,6 +31,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;
@@ -792,22 +793,13 @@ 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 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,
-                    )
+                    collect_intra_doc_links::early_resolve_intra_doc_links(resolver, krate)
                 });
-                (resolver.clone(), resolver_caches)
+                resolver_caches
             };
 
             if sess.diagnostic().has_errors_or_lint_errors().is_some() {
@@ -820,7 +812,6 @@ fn main_args(at_args: &[String]) -> MainResult {
                 let (krate, render_opts, mut cache) = sess.time("run_global_ctxt", || {
                     core::run_global_ctxt(
                         tcx,
-                        resolver,
                         resolver_caches,
                         show_coverage,
                         render_options,