From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/rustdoc-js/generics.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/rustdoc-js/generics.rs (limited to 'tests/rustdoc-js/generics.rs') diff --git a/tests/rustdoc-js/generics.rs b/tests/rustdoc-js/generics.rs new file mode 100644 index 000000000..055c51c7e --- /dev/null +++ b/tests/rustdoc-js/generics.rs @@ -0,0 +1,28 @@ +pub struct P; +pub struct Q; +pub struct R(T); + +// returns test +pub fn alef() -> R

{ loop {} } +pub fn bet() -> R { loop {} } + +// in_args test +pub fn alpha(_x: R

) { loop {} } +pub fn beta(_x: R) { loop {} } + +// test case with multiple appearances of the same type +pub struct ExtraCreditStructMulti { t: T, u: U } +pub struct ExtraCreditInnerMulti {} +pub fn extracreditlabhomework( + _param: ExtraCreditStructMulti +) { loop {} } +pub fn redherringmatchforextracredit( + _param: ExtraCreditStructMulti +) { loop {} } + +pub trait TraitCat {} +pub trait TraitDog {} + +pub fn gamma(t: T) {} + +pub fn super_soup(s: Result) -> Result { s } -- cgit v1.2.3