From a9eacf33b7517fa0b21a2aaab45ccc68cb85e06f Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Tue, 10 Nov 2020 13:22:28 +0100 Subject: [PATCH] add error-in-impl-trait const generics test --- .../error-in-impl-trait/const-generics.rs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/rustdoc-ui/error-in-impl-trait/const-generics.rs 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 000000000000..97760cbf8fb5 --- /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() -> impl Iterator { + loop {} +} + +pub trait Trait {} +impl Trait<1> for u8 {} +impl Trait<2> for u8 {} +impl Trait for [u8; N] {} + +/// This also has docs +pub fn test() -> impl Trait where u8: Trait { + loop {} +} + +/// Document all the functions +pub async fn a_sink(v: [u8; N]) -> impl Trait { + loop {} +}