Hide host effect params from docs by oli-obk · Pull Request #116670 · rust-lang/rust (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're just looking for ConstKind::Param
, we obviously don't hide host args like false
, true
or more complex const exprs (we'd need to check the corresp. ty::Generics
first I think). Could you add a FIXME(effects)
for this as well / extend the previous one.
I only know of one case where this currently surfaces (without using #![feature(rustc_attrs)]
+ #[rustc_host]
). Namely, documenting the cross-crate re-export of pub fn h<T: Tr>() {}
where Tr
is a const trait results in pub fn h<T>() where T: Tr<true>
since we currently don't elide defaulted args in cross-crate scenarios (#80379). My PR #112463 would fix this specific case but it's blocked on performance.
(This would also surface with always-const bounds if they were introduced like T: const Trait
→ T: Trait<false>
, etc.)