1
Fork 0

rustdoc: search for tuples and unit by type with ()

This commit is contained in:
Michael Howell 2023-09-29 12:52:30 -07:00
parent a75fed74b6
commit f6a045cc6b
9 changed files with 616 additions and 54 deletions

View file

@ -0,0 +1,18 @@
pub struct P;
pub struct Q;
pub struct R<T>(T);
// Checks that tuple and unit both work
pub fn side_effect() { }
// Check a non-tuple
pub fn not_tuple() -> P { loop {} }
// Check a 1-tuple
pub fn one() -> (P,) { loop {} }
// Check a 2-tuple
pub fn two() -> (P,P) { loop {} }
// Check a nested tuple
pub fn nest() -> (Q, R<(u32,)>) { loop {} }