about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-08-25 23:07:03 +0200
committerUrgau <urgau@numericable.fr>2023-08-28 14:03:33 +0200
commit706d010c8b590f40cc2fb3de7b744d9a59a93ac9 (patch)
tree77b1170aabb204590d9bb2260644d5bdd4a167fc /tests
parent282acb93c91371bfcb9256c274a932d45207fa03 (diff)
downloadrust-706d010c8b590f40cc2fb3de7b744d9a59a93ac9.tar.gz
rust-706d010c8b590f40cc2fb3de7b744d9a59a93ac9.zip
rustdoc: always print type alias inner type (with it's where clauses)
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs34
-rw-r--r--tests/rustdoc/typedef-inner-variants.rs8
2 files changed, 39 insertions, 3 deletions
diff --git a/tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs b/tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs
new file mode 100644
index 00000000000..ff84352d716
--- /dev/null
+++ b/tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs
@@ -0,0 +1,34 @@
+#![crate_name = "inner_types_lazy"]
+
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+// @has 'inner_types_lazy/struct.Pair.html'
+pub struct Pair<A, B> {
+    pub first: A,
+    pub second: B,
+}
+
+// @has 'inner_types_lazy/type.ReversedTypesPair.html'
+// @count - '//*[@id="aliased-type"]' 1
+// @count - '//*[@id="variants"]' 0
+// @count - '//*[@id="fields"]' 1
+// @count - '//span[@class="where fmt-newline"]' 0
+pub type ReversedTypesPair<Q, R> = Pair<R, Q>;
+
+// @has 'inner_types_lazy/type.ReadWrite.html'
+// @count - '//*[@id="aliased-type"]' 1
+// @count - '//*[@id="variants"]' 0
+// @count - '//*[@id="fields"]' 1
+// @count - '//span[@class="where fmt-newline"]' 2
+pub type ReadWrite<R, W> = Pair<R, W>
+where
+    R: std::io::Read,
+    W: std::io::Write;
+
+// @has 'inner_types_lazy/type.VecPair.html'
+// @count - '//*[@id="aliased-type"]' 1
+// @count - '//*[@id="variants"]' 0
+// @count - '//*[@id="fields"]' 1
+// @count - '//span[@class="where fmt-newline"]' 0
+pub type VecPair<U, V> = Pair<Vec<U>, Vec<V>>;
diff --git a/tests/rustdoc/typedef-inner-variants.rs b/tests/rustdoc/typedef-inner-variants.rs
index 31edb0a8706..b734714fd64 100644
--- a/tests/rustdoc/typedef-inner-variants.rs
+++ b/tests/rustdoc/typedef-inner-variants.rs
@@ -38,7 +38,8 @@ pub enum IrTyKind<A, I: Interner> {
 }
 
 // @has 'inner_variants/type.NearlyTyKind.html'
-// @count - '//*[@id="variants"]' 0
+// @count - '//*[@id="aliased-type"]' 1
+// @count - '//*[@id="variants"]' 1
 // @count - '//*[@id="fields"]' 0
 pub type NearlyTyKind<A> = IrTyKind<A, TyCtxt>;
 
@@ -103,11 +104,12 @@ pub struct HighlyGenericStruct<A, B, C, D> {
     pub z: (A, B, C, D)
 }
 
-// VERIFY that we NOT show the Aliased Type
 // @has 'inner_variants/type.HighlyGenericAABB.html'
 // @count - '//*[@id="aliased-type"]' 1
 // @count - '//*[@id="variants"]' 0
-// @count - '//*[@id="fields"]' 0
+// @count - '//*[@id="fields"]' 1
+// @matches - '//pre[@class="rust item-decl"]//code' "struct HighlyGenericAABB<A, B>"
+// @matches - '//pre[@class="rust item-decl"]//code' "pub z"
 pub type HighlyGenericAABB<A, B> = HighlyGenericStruct<A, A, B, B>;
 
 // @has 'inner_variants/type.InlineU64.html'