diff options
Diffstat (limited to 'src/test/ui/impl-trait/in-trait/opaque-in-impl.rs')
-rw-r--r-- | src/test/ui/impl-trait/in-trait/opaque-in-impl.rs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/test/ui/impl-trait/in-trait/opaque-in-impl.rs b/src/test/ui/impl-trait/in-trait/opaque-in-impl.rs deleted file mode 100644 index 2e0662969..000000000 --- a/src/test/ui/impl-trait/in-trait/opaque-in-impl.rs +++ /dev/null @@ -1,48 +0,0 @@ -// check-pass - -#![feature(return_position_impl_trait_in_trait)] -#![allow(incomplete_features)] - -use std::fmt::Debug; - -trait Foo { - fn foo(&self) -> impl Debug; -} - -impl Foo for () { - fn foo(&self) -> impl Debug { - "Hello, world" - } -} - -impl<T: Default + Debug> Foo for std::marker::PhantomData<T> { - fn foo(&self) -> impl Debug { - T::default() - } -} - -trait Bar { - fn bar<T>(&self) -> impl Debug; -} - -impl Bar for () { - fn bar<T>(&self) -> impl Debug { - format!("Hello with generic {}", std::any::type_name::<T>()) - } -} - -trait Baz { - fn baz(&self) -> impl Debug + '_; -} - -impl Baz for String { - fn baz(&self) -> impl Debug + '_ { - (self,) - } -} - -fn main() { - println!("{:?}", ().foo()); - println!("{:?}", ().bar::<u64>()); - println!("{:?}", "hi".to_string().baz()); -} |