about summary refs log tree commit diff
path: root/compiler/rustc_passes/src
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-08-24 13:56:56 -0700
committerMichael Howell <michael@notriddle.com>2024-08-24 14:06:57 -0700
commit6df0ccf49e7311ef0f81298edf0b77cd204c1ba3 (patch)
tree3c7c77d330fb23ea2b51bbbe411180b3a423d860 /compiler/rustc_passes/src
parentf167efad2f51088d86180ee89177b3d7c9e7c2f5 (diff)
downloadrust-6df0ccf49e7311ef0f81298edf0b77cd204c1ba3.tar.gz
rust-6df0ccf49e7311ef0f81298edf0b77cd204c1ba3.zip
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.
Diffstat (limited to 'compiler/rustc_passes/src')
-rw-r--r--compiler/rustc_passes/src/check_attr.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index c93fb5c23b1..ffa406133cc 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -951,6 +951,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() });