From: varkor Date: Tue, 28 May 2019 21:53:36 +0000 (+0100) Subject: Add a const-generics folder to rustdoc tests X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=7f9dc73a31b94b76a87151467d0dd6dfc186a573;p=rust.git Add a const-generics folder to rustdoc tests --- diff --git a/src/test/rustdoc/const-generics/const-impl.rs b/src/test/rustdoc/const-generics/const-impl.rs new file mode 100644 index 00000000000..85ee6d3376b --- /dev/null +++ b/src/test/rustdoc/const-generics/const-impl.rs @@ -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' +// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl Send for VSet' +// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl Sync for VSet' +pub struct VSet { + inner: Vec, +} + +// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl VSet' +impl VSet { + pub fn new() -> Self { + Self { inner: Vec::new() } + } +} + +// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl VSet' +impl VSet { + 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 index d6794ac8f1d..00000000000 --- a/src/test/rustdoc/generic-const.rs +++ /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' -// @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl Send for VSet' -// @has foo/struct.VSet.html '//h3[@id="impl-Sync"]/code' 'impl Sync for VSet' -pub struct VSet { - inner: Vec, -} - -// @has foo/struct.VSet.html '//h3[@id="impl"]/code' 'impl VSet' -impl VSet { - pub fn new() -> Self { - Self { inner: Vec::new() } - } -} - -// @has foo/struct.VSet.html '//h3[@id="impl-1"]/code' 'impl VSet' -impl VSet { - pub fn new() -> Self { - Self { inner: Vec::new() } - } -}