]> git.proxmox.com Git - rustc.git/blame - src/test/ui/impl-trait/in-trait/nested-rpitit.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / impl-trait / in-trait / nested-rpitit.rs
CommitLineData
f2b60f7d
FG
1// check-pass
2
3#![feature(return_position_impl_trait_in_trait)]
4#![allow(incomplete_features)]
5
6use std::fmt::Display;
7use std::ops::Deref;
8
9trait Foo {
10 fn bar(self) -> impl Deref<Target = impl Display + ?Sized>;
11}
12
13struct A;
14
15impl Foo for A {
16 fn bar(self) -> &'static str {
17 "Hello, world"
18 }
19}
20
21struct B;
22
23impl Foo for B {
24 fn bar(self) -> Box<i32> {
25 Box::new(42)
26 }
27}
28
29fn main() {
30 println!("Message for you: {:?}", &*A.bar());
31 println!("Another for you: {:?}", &*B.bar());
32}