]> git.lizzy.rs Git - rust.git/commitdiff
Add a const-generics folder to rustdoc tests
authorvarkor <github@varkor.com>
Tue, 28 May 2019 21:53:36 +0000 (22:53 +0100)
committervarkor <github@varkor.com>
Tue, 28 May 2019 21:53:36 +0000 (22:53 +0100)
src/test/rustdoc/const-generics/const-impl.rs [new file with mode: 0644]
src/test/rustdoc/generic-const.rs [deleted file]

diff --git a/src/test/rustdoc/const-generics/const-impl.rs b/src/test/rustdoc/const-generics/const-impl.rs
new file mode 100644 (file)
index 0000000..85ee6d3
--- /dev/null
@@ -0,0 +1,31 @@
+// ignore-tidy-linelength
+
+#![feature(const_generics)]
+
+#![crate_name = "foo"]
+
+pub enum Order {
+    Sorted,
+    Unsorted,
+}
+
+// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
+// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send for VSet<T, ORDER>'
+// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<const ORDER: Order, T> Sync for VSet<T, ORDER>'
+pub struct VSet<T, const ORDER: Order> {
+    inner: Vec<T>,
+}
+
+// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, { Order::Sorted }>'
+impl <T> VSet<T, {Order::Sorted}> {
+    pub fn new() -> Self {
+        Self { inner: Vec::new() }
+    }
+}
+
+// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, { Order::Unsorted }>'
+impl <T> VSet<T, {Order::Unsorted}> {
+    pub fn new() -> Self {
+        Self { inner: Vec::new() }
+    }
+}
diff --git a/src/test/rustdoc/generic-const.rs b/src/test/rustdoc/generic-const.rs
deleted file mode 100644 (file)
index d6794ac..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#![feature(const_generics)]
-#![crate_name = "foo"]
-
-// ignore-tidy-linelength
-
-pub enum Order {
-    Sorted,
-    Unsorted,
-}
-
-// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
-// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send for VSet<T, ORDER>'
-// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl<const ORDER: Order, T> Sync for VSet<T, ORDER>'
-pub struct VSet<T, const ORDER: Order> {
-    inner: Vec<T>,
-}
-
-// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl<T> VSet<T, { Order::Sorted }>'
-impl <T> VSet<T, {Order::Sorted}> {
-    pub fn new() -> Self {
-        Self { inner: Vec::new() }
-    }
-}
-
-// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl<T> VSet<T, { Order::Unsorted }>'
-impl <T> VSet<T, {Order::Unsorted}> {
-    pub fn new() -> Self {
-        Self { inner: Vec::new() }
-    }
-}