1
Fork 0

rustdoc: prevent ctors from resolving

This commit is contained in:
Michael Howell 2024-10-03 17:42:08 -07:00
parent 9ff5fc4ffb
commit 253fec494f
5 changed files with 105 additions and 6 deletions

View file

@ -2148,7 +2148,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
match self.maybe_resolve_path(&segments, Some(ns), &parent_scope, None) {
PathResult::Module(ModuleOrUniformRoot::Module(module)) => Some(module.res().unwrap()),
PathResult::NonModule(path_res) => path_res.full_res(),
PathResult::NonModule(path_res) => {
path_res.full_res().filter(|res| !matches!(res, Res::Def(DefKind::Ctor(..), _)))
}
PathResult::Module(ModuleOrUniformRoot::ExternPrelude) | PathResult::Failed { .. } => {
None
}