diff options
| author | bors <bors@rust-lang.org> | 2023-03-11 14:45:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-03-11 14:45:14 +0000 |
| commit | 67e1681c1db9545ec05c458cad440a9197617a30 (patch) | |
| tree | 05a239fccc142440bfe32b0bff8309da9ef9dc69 /compiler/rustc_resolve/src/lib.rs | |
| parent | e350fe4e608b653da47e8012d13ef701613e717b (diff) | |
| parent | e12ba7300ae8936fe5627b43719a8b9df7e9a730 (diff) | |
| download | rust-67e1681c1db9545ec05c458cad440a9197617a30.tar.gz rust-67e1681c1db9545ec05c458cad440a9197617a30.zip | |
Auto merge of #109015 - matthiaskrgr:rollup-xu2s31g, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #106276 (Fix `vec_deque::Drain` FIXME) - #107629 (rustdoc: sort deprecated items lower in search) - #108711 (Add note when matching token with nonterminal) - #108757 (rustdoc: Migrate `document_item_info` to Askama) - #108784 (rustdoc: Migrate sidebar rendering to Askama) - #108927 (Move __thread_local_inner to sys) - #108949 (Honor current target when checking conditional compilation values) - #108950 (Directly construct Inherited in typeck.) - #108988 (rustdoc: Don't crash on `crate` references in blocks) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_resolve/src/lib.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/lib.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 5eba208e3ed..f6888e55ad4 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1849,20 +1849,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { &mut self, path_str: &str, ns: Namespace, - mut parent_scope: ParentScope<'a>, + parent_scope: ParentScope<'a>, ) -> Option<Res> { let mut segments = Vec::from_iter(path_str.split("::").map(Ident::from_str).map(Segment::from_ident)); if let Some(segment) = segments.first_mut() { - if segment.ident.name == kw::Crate { - // FIXME: `resolve_path` always resolves `crate` to the current crate root, but - // rustdoc wants it to resolve to the `parent_scope`'s crate root. This trick of - // replacing `crate` with `self` and changing the current module should achieve - // the same effect. - segment.ident.name = kw::SelfLower; - parent_scope.module = - self.expect_module(parent_scope.module.def_id().krate.as_def_id()); - } else if segment.ident.name == kw::Empty { + if segment.ident.name == kw::Empty { segment.ident.name = kw::PathRoot; } } |
