about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-11-12 13:10:07 +0000
committerbors <bors@rust-lang.org>2020-11-12 13:10:07 +0000
commit7f5a42b073dc2bee2aa625052eb066ee07072048 (patch)
treeaa2c47a52e7b3637d4602303b4e9b7890e324da3 /src/test/rustdoc-ui
parent12f0dba618e761c987142474435dff95ab177f3c (diff)
parentcac8ac61dd3918aa771bbc97d2cb9e82901d101d (diff)
downloadrust-7f5a42b073dc2bee2aa625052eb066ee07072048.tar.gz
rust-7f5a42b073dc2bee2aa625052eb066ee07072048.zip
Auto merge of #78976 - GuillaumeGomez:rollup-endkih3, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #78916 (extend const generics test suite)
 - #78921 (Improve the page title switch handling between search and doc)
 - #78933 (Don't print thread ids and names in `tracing` logs)
 - #78960 (Test default values for const parameters.)
 - #78971 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/rustdoc-ui')
-rw-r--r--src/test/rustdoc-ui/error-in-impl-trait/const-generics.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/error-in-impl-trait/const-generics.rs b/src/test/rustdoc-ui/error-in-impl-trait/const-generics.rs
new file mode 100644
index 00000000000..97760cbf8fb
--- /dev/null
+++ b/src/test/rustdoc-ui/error-in-impl-trait/const-generics.rs
@@ -0,0 +1,24 @@
+// check-pass
+// edition:2018
+#![feature(min_const_generics)]
+trait ValidTrait {}
+
+/// This has docs
+pub fn extern_fn<const N: usize>() -> impl Iterator<Item = [u8; N]> {
+    loop {}
+}
+
+pub trait Trait<const N: usize> {}
+impl Trait<1> for u8 {}
+impl Trait<2> for u8 {}
+impl<const N: usize> Trait<N> for [u8; N] {}
+
+/// This also has docs
+pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N> {
+    loop {}
+}
+
+/// Document all the functions
+pub async fn a_sink<const N: usize>(v: [u8; N]) -> impl Trait<N> {
+    loop {}
+}