]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_resolve/src/macros.rs
Rollup merge of #103280 - finnbear:impl_string_leak_2, r=joshtriplett
[rust.git] / compiler / rustc_resolve / src / macros.rs
index dafa10e9e0026ff4ad4c32fc8f511a1bf73b8f2e..f6f0b3c11391b2024df4f80de372a8abd2e51ef9 100644 (file)
@@ -590,9 +590,7 @@ pub fn resolve_macro_path(
 
         let res = if path.len() > 1 {
             let res = match self.maybe_resolve_path(&path, Some(MacroNS), parent_scope) {
-                PathResult::NonModule(path_res) if path_res.unresolved_segments() == 0 => {
-                    Ok(path_res.base_res())
-                }
+                PathResult::NonModule(path_res) if let Some(res) = path_res.full_res() => Ok(res),
                 PathResult::Indeterminate if !force => return Err(Determinacy::Undetermined),
                 PathResult::NonModule(..)
                 | PathResult::Indeterminate
@@ -692,9 +690,8 @@ pub(crate) fn finalize_macro_resolutions(&mut self) {
                 Some(Finalize::new(ast::CRATE_NODE_ID, path_span)),
                 None,
             ) {
-                PathResult::NonModule(path_res) if path_res.unresolved_segments() == 0 => {
-                    let res = path_res.base_res();
-                    check_consistency(self, &path, path_span, kind, initial_res, res);
+                PathResult::NonModule(path_res) if let Some(res) = path_res.full_res() => {
+                    check_consistency(self, &path, path_span, kind, initial_res, res)
                 }
                 path_res @ PathResult::NonModule(..) | path_res @ PathResult::Failed { .. } => {
                     let (span, label) = if let PathResult::Failed { span, label, .. } = path_res {