-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Remove CURRENT_DEPTH
thread-local variable
#82815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2292,14 +2292,16 @@ impl Clean<Item> for (&hir::MacroDef<'_>, Option<Symbol>) { | |
if matchers.len() <= 1 { | ||
format!( | ||
"{}macro {}{} {{\n ...\n}}", | ||
vis.print_with_space(cx.tcx, def_id, &cx.cache), | ||
// FIXME(camelid): this might create broken links! | ||
vis.print_with_space(cx.tcx, def_id, &cx.cache, 0), | ||
name, | ||
matchers.iter().map(|span| span.to_src(cx)).collect::<String>(), | ||
) | ||
} else { | ||
format!( | ||
"{}macro {} {{\n{}}}", | ||
vis.print_with_space(cx.tcx, def_id, &cx.cache), | ||
// FIXME(camelid): this might create broken links! | ||
vis.print_with_space(cx.tcx, def_id, &cx.cache, 0), | ||
|
||
name, | ||
matchers | ||
.iter() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -414,7 +414,10 @@ crate fn resolve_type(cx: &mut DocContext<'_>, path: Path, id: hir::HirId) -> Ty | |
return Generic(kw::SelfUpper); | ||
} | ||
Res::Def(DefKind::TyParam, _) if path.segments.len() == 1 => { | ||
return Generic(Symbol::intern(&format!("{:#}", path.print(&cx.cache)))); | ||
// FIXME(camelid): I hope passing 0 as the depth doesn't break anything.... | ||
// Then again, I think used to be 0 anyway through CURRENT_DEPTH | ||
// because (I think) rendering hadn't started yet. | ||
return Generic(Symbol::intern(&format!("{:#}", path.print(&cx.cache, 0)))); | ||
|
||
} | ||
Res::SelfTy(..) | Res::Def(DefKind::TyParam | DefKind::AssocTy, _) => true, | ||
_ => false, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this has the same behavior as before, but we should probably test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will break for macros in submodules (e.g.
pub mod inner { pub macro foo() {} }
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, so it looks like we don't use links in macro visibilities on nightly anyway:
So I'm not sure how to test the changes :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a bug, could you open an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: #83000. Nice issue number :)