about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-01 20:14:07 +0000
committerbors <bors@rust-lang.org>2021-12-01 20:14:07 +0000
commit48a5999fceeea84a8971634355287faa349909d4 (patch)
tree9ad663ffaf4c2f4fa545f7123dc7b3bba066ff2d /src/test/rustdoc-ui
parent3c51718ae7ae3160058e220b879d2a69533973a7 (diff)
parent4ae75cfa2e01f383ba610038aca2356197f8ac75 (diff)
Auto merge of #91433 - matthiaskrgr:rollup-118ql06, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #88502 (Add slice take methods)
 - #91313 (expand: Turn `ast::Crate` into a first class expansion target)
 - #91424 (Update LLVM with patches for better llvm-cov diagnostics)
 - #91425 (Include lint errors in error count for `-Ztreat-err-as-bug`)
 - #91430 (Add tests for `normalize-docs` overflow errors)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/rustdoc-ui')
-rw-r--r--src/test/rustdoc-ui/auxiliary/overflow.rs20
-rw-r--r--src/test/rustdoc-ui/normalize-cycle.rs25
-rw-r--r--src/test/rustdoc-ui/normalize-overflow.rs3
3 files changed, 48 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/auxiliary/overflow.rs b/src/test/rustdoc-ui/auxiliary/overflow.rs
new file mode 100644
index 00000000000..ff65936bec9
--- /dev/null
+++ b/src/test/rustdoc-ui/auxiliary/overflow.rs
@@ -0,0 +1,20 @@
+pub struct B0;
+pub struct B1;
+use std::ops::Shl;
+use std::ops::Sub;
+pub type Shleft<A, B> = <A as Shl<B>>::Output;
+pub type Sub1<A> = <A as Sub<B1>>::Output;
+pub struct UInt<U, B> {
+    pub(crate) msb: U,
+    pub(crate) lsb: B,
+}
+impl<U, B, Ur, Br> Shl<UInt<Ur, Br>> for UInt<U, B>
+where
+    UInt<Ur, Br>: Sub<B1>,
+    UInt<UInt<U, B>, B0>: Shl<Sub1<UInt<Ur, Br>>>,
+{
+    type Output = Shleft<UInt<UInt<U, B>, B0>, Sub1<UInt<Ur, Br>>>;
+    fn shl(self, rhs: UInt<Ur, Br>) -> Self::Output {
+        unimplemented!()
+    }
+}
diff --git a/src/test/rustdoc-ui/normalize-cycle.rs b/src/test/rustdoc-ui/normalize-cycle.rs
new file mode 100644
index 00000000000..f48cad373cd
--- /dev/null
+++ b/src/test/rustdoc-ui/normalize-cycle.rs
@@ -0,0 +1,25 @@
+// check-pass
+// Regresion test for <https://github.com/rust-lang/rust/issues/79459>.
+pub trait Query {}
+
+pub trait AsQuery {
+    type Query;
+}
+
+impl<T: Query> AsQuery for T {
+    type Query = T;
+}
+
+pub trait SelectDsl<Selection> {
+    type Output;
+}
+
+impl<T, Selection> SelectDsl<Selection> for T
+where
+    T: AsQuery,
+    T::Query: SelectDsl<Selection>,
+{
+    type Output = <T::Query as SelectDsl<Selection>>::Output;
+}
+
+pub type Select<Source, Selection> = <Source as SelectDsl<Selection>>::Output;
diff --git a/src/test/rustdoc-ui/normalize-overflow.rs b/src/test/rustdoc-ui/normalize-overflow.rs
new file mode 100644
index 00000000000..0cdcc88e314
--- /dev/null
+++ b/src/test/rustdoc-ui/normalize-overflow.rs
@@ -0,0 +1,3 @@
+// aux-crate:overflow=overflow.rs
+// check-pass
+// Regression test for <https://github.com/rust-lang/rust/issues/79506>.