]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/in-trait/issue-102571.rs
Rollup merge of #105405 - sunfishcode:sunfishcode/export-dynamic, r=TaKO8Ki
[rust.git] / src / test / ui / impl-trait / in-trait / issue-102571.rs
1 #![feature(return_position_impl_trait_in_trait)]
2 #![allow(incomplete_features)]
3
4 use std::fmt::Display;
5 use std::ops::Deref;
6
7 trait Foo {
8     fn bar(self) -> impl Deref<Target = impl Display + ?Sized>;
9 }
10
11 struct A;
12
13 impl Foo for A {
14     fn bar(self) -> &'static str {
15         "Hello, world"
16     }
17 }
18
19 fn foo<T: Foo>(t: T) {
20     let () = t.bar();
21     //~^ ERROR mismatched types
22 }
23
24 fn main() {}