diff options
Diffstat (limited to 'tests/ui/impl-trait/in-trait/issue-102571.rs')
-rw-r--r-- | tests/ui/impl-trait/in-trait/issue-102571.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.rs b/tests/ui/impl-trait/in-trait/issue-102571.rs new file mode 100644 index 000000000..61c91e644 --- /dev/null +++ b/tests/ui/impl-trait/in-trait/issue-102571.rs @@ -0,0 +1,24 @@ +#![feature(return_position_impl_trait_in_trait)] +#![allow(incomplete_features)] + +use std::fmt::Display; +use std::ops::Deref; + +trait Foo { + fn bar(self) -> impl Deref<Target = impl Display + ?Sized>; +} + +struct A; + +impl Foo for A { + fn bar(self) -> &'static str { + "Hello, world" + } +} + +fn foo<T: Foo>(t: T) { + let () = t.bar(); + //~^ ERROR mismatched types +} + +fn main() {} |