diff options
Diffstat (limited to 'tests/ui/impl-trait/in-trait/wf-bounds.rs')
-rw-r--r-- | tests/ui/impl-trait/in-trait/wf-bounds.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.rs b/tests/ui/impl-trait/in-trait/wf-bounds.rs index 1c9590bd8..f8c1e561d 100644 --- a/tests/ui/impl-trait/in-trait/wf-bounds.rs +++ b/tests/ui/impl-trait/in-trait/wf-bounds.rs @@ -5,10 +5,14 @@ #![feature(return_position_impl_trait_in_trait)] #![allow(incomplete_features)] +use std::fmt::Display; + trait Wf<T> { type Output; } +struct NeedsDisplay<T: Display>(T); + trait Uwu { fn nya() -> impl Wf<Vec<[u8]>>; //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time @@ -18,6 +22,9 @@ trait Uwu { fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>; //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time + + fn nya4<T>() -> impl Wf<NeedsDisplay<T>>; + //~^ ERROR `T` doesn't implement `std::fmt::Display` } fn main() {} |