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:
commit
aa26e1ad97
4 changed files with 122 additions and 55 deletions
|
@ -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() });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue