Skip to content

Commit

Permalink
rustdoc: properly elide cross-crate host effect args
Browse files Browse the repository at this point in the history
  • Loading branch information
fmease committed Nov 3, 2023
1 parent ffb7ed9 commit 1f74e13
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2534,7 +2534,6 @@ fn clean_generic_args<'tcx>(
}
hir::GenericArg::Lifetime(_) => GenericArg::Lifetime(Lifetime::elided()),
hir::GenericArg::Type(ty) => GenericArg::Type(clean_ty(ty, cx)),
// FIXME(effects): This will still emit `<true>` for non-const impls of const traits
hir::GenericArg::Const(ct)
if cx.tcx.has_attr(ct.value.def_id, sym::rustc_host) =>
{
Expand Down
6 changes: 1 addition & 5 deletions src/librustdoc/clean/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ pub(crate) fn ty_args_to_args<'tcx>(
)))
}
GenericArgKind::Const(ct) => {
// FIXME(effects): this relies on the host effect being called `host`, which users could also name
// their const generics.
// FIXME(effects): this causes `host = true` and `host = false` generics to also be emitted.
if let ty::ConstKind::Param(p) = ct.kind()
&& p.name == sym::host
if let ty::GenericParamDefKind::Const { is_host_effect: true, .. } = params[index].kind
{
return None;
}
Expand Down

0 comments on commit 1f74e13

Please sign in to comment.