From 591ec49df312ec4cbcdec0f082f123f473c182a9 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Thu, 6 Jan 2022 14:45:23 -0800 Subject: [PATCH] Remove unnecessary conditional for suggesting disambiguator Now that `res` is used directly, it seems the conditional is unnecessary. --- src/librustdoc/passes/collect_intra_doc_links.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 20e248a445cb..dd2fa9d62736 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -2062,10 +2062,7 @@ fn split(path: &str) -> Option<(&str, &str)> { ResolutionFailure::NotResolved { .. } => unreachable!("handled above"), ResolutionFailure::Dummy => continue, ResolutionFailure::WrongNamespace { res, expected_ns } => { - // FIXME: does this need to be behind an `if`? - if matches!(res, Res::Def(..)) { - suggest_disambiguator(res, diag, path_str, diag_info.ori_link, sp); - } + suggest_disambiguator(res, diag, path_str, diag_info.ori_link, sp); format!( "this link resolves to {}, which is not in the {} namespace",