1
Fork 0

Rollup merge of #129525 - notriddle:notriddle/fake-variadic-tuple-array, r=GuillaumeGomez

rustdoc: clean up tuple <-> primitive conversion docs

This adds a minor missing feature to `fake_variadic`, so that it can render `impl From<(T,)> for [T; 1]` correctly.
This commit is contained in:
Matthias Krüger 2024-08-26 01:49:02 +02:00 committed by GitHub
commit aa26e1ad97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 122 additions and 55 deletions

View file

@ -952,6 +952,16 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
bare_fn_ty.decl.inputs.len() == 1
} else {
false
}
|| if let Some(&[hir::GenericArg::Type(ty)]) = i
.of_trait
.as_ref()
.and_then(|trait_ref| trait_ref.path.segments.last())
.map(|last_segment| last_segment.args().args)
{
matches!(&ty.kind, hir::TyKind::Tup([_]))
} else {
false
};
if !is_valid {
self.dcx().emit_err(errors::DocFakeVariadicNotValid { span: meta.span() });