Skip to content

Commit 1f74e13

Browse files
committed
rustdoc: properly elide cross-crate host effect args
1 parent ffb7ed9 commit 1f74e13

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/librustdoc/clean/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2534,7 +2534,6 @@ fn clean_generic_args<'tcx>(
25342534
}
25352535
hir::GenericArg::Lifetime(_) => GenericArg::Lifetime(Lifetime::elided()),
25362536
hir::GenericArg::Type(ty) => GenericArg::Type(clean_ty(ty, cx)),
2537-
// FIXME(effects): This will still emit `<true>` for non-const impls of const traits
25382537
hir::GenericArg::Const(ct)
25392538
if cx.tcx.has_attr(ct.value.def_id, sym::rustc_host) =>
25402539
{

src/librustdoc/clean/utils.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,7 @@ pub(crate) fn ty_args_to_args<'tcx>(
124124
)))
125125
}
126126
GenericArgKind::Const(ct) => {
127-
// FIXME(effects): this relies on the host effect being called `host`, which users could also name
128-
// their const generics.
129-
// FIXME(effects): this causes `host = true` and `host = false` generics to also be emitted.
130-
if let ty::ConstKind::Param(p) = ct.kind()
131-
&& p.name == sym::host
127+
if let ty::GenericParamDefKind::Const { is_host_effect: true, .. } = params[index].kind
132128
{
133129
return None;
134130
}

0 commit comments

Comments
 (0)