Rollup merge of #107951 - petrochenkov:procmacdoc, r=jackh726
resolve: Fix doc links referring to other crates when documenting proc macro crates directly Fixes https://github.com/rust-lang/rust/issues/107950
This commit is contained in:
commit
4a0f088f7c
2 changed files with 33 additions and 1 deletions
|
@ -4211,7 +4211,8 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
if let Some(res) = res
|
||||
&& let Some(def_id) = res.opt_def_id()
|
||||
&& !def_id.is_local()
|
||||
&& self.r.session.crate_types().contains(&CrateType::ProcMacro) {
|
||||
&& self.r.session.crate_types().contains(&CrateType::ProcMacro)
|
||||
&& matches!(self.r.session.opts.resolve_doc_links, ResolveDocLinks::ExportedMetadata) {
|
||||
// Encoding foreign def ids in proc macro crate metadata will ICE.
|
||||
return None;
|
||||
}
|
||||
|
@ -4281,6 +4282,10 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
.filter_map(|tr| {
|
||||
if !tr.def_id.is_local()
|
||||
&& self.r.session.crate_types().contains(&CrateType::ProcMacro)
|
||||
&& matches!(
|
||||
self.r.session.opts.resolve_doc_links,
|
||||
ResolveDocLinks::ExportedMetadata
|
||||
)
|
||||
{
|
||||
// Encoding foreign def ids in proc macro crate metadata will ICE.
|
||||
return None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue