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.
This commit is contained in:
Vadim Petrochenkov
2022-02-01 20:30:32 +08:00
parent a12d31d5a6
commit b62b82aef4
28 changed files with 653 additions and 853 deletions

View File

@@ -95,7 +95,7 @@ impl<'a> Resolver<'a> {
/// Reachable macros with block module parents exist due to `#[macro_export] macro_rules!`,
/// but they cannot use def-site hygiene, so the assumption holds
/// (<https://github.com/rust-lang/rust/pull/77984#issuecomment-712445508>).
pub fn get_nearest_non_block_module(&mut self, mut def_id: DefId) -> Module<'a> {
pub(crate) fn get_nearest_non_block_module(&mut self, mut def_id: DefId) -> Module<'a> {
loop {
match self.get_module(def_id) {
Some(module) => return module,
@@ -104,7 +104,7 @@ impl<'a> Resolver<'a> {
}
}
pub fn expect_module(&mut self, def_id: DefId) -> Module<'a> {
pub(crate) fn expect_module(&mut self, def_id: DefId) -> Module<'a> {
self.get_module(def_id).expect("argument `DefId` is not a module")
}