diff options
| author | varkor <github@varkor.com> | 2019-05-28 22:53:48 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-05-28 22:53:48 +0100 |
| commit | 9c9b7b4eaceefe88bafc3b4e3529635973320253 (patch) | |
| tree | 54fff85b3273f7842693fe1ec7fe8caffb4be12a | |
| parent | 7f9dc73a31b94b76a87151467d0dd6dfc186a573 (diff) | |
| download | rust-9c9b7b4eaceefe88bafc3b4e3529635973320253.tar.gz rust-9c9b7b4eaceefe88bafc3b4e3529635973320253.zip | |
Add a regression test for unevaluated const in rustdoc
| -rw-r--r-- | src/test/rustdoc/const-generics/add-impl.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/rustdoc/const-generics/add-impl.rs b/src/test/rustdoc/const-generics/add-impl.rs new file mode 100644 index 00000000000..ed45d339728 --- /dev/null +++ b/src/test/rustdoc/const-generics/add-impl.rs @@ -0,0 +1,21 @@ +// ignore-tidy-linelength + +#![feature(const_generics)] + +#![crate_name = "foo"] + +use std::ops::Add; + +// @has foo/struct.Simd.html '//pre[@class="rust struct"]' 'pub struct Simd<T, const WIDTH: usize>' +pub struct Simd<T, const WIDTH: usize> { + inner: T, +} + +// @has foo/struct.Simd.html '//div[@id="implementations-list"]/h3/code' 'impl Add<Simd<u8, 16>> for Simd<u8, 16>' +impl Add for Simd<u8, 16> { + type Output = Self; + + fn add(self, rhs: Self) -> Self::Output { + Self { inner: 0 } + } +} |
