]>
Commit | Line | Data |
---|---|---|
94222f64 | 1 | #![feature(type_alias_impl_trait)] |
416331ca XL |
2 | |
3 | use std::fmt::Debug; | |
4 | ||
5 | pub trait Foo { | |
6 | type Item: Debug; | |
7 | ||
8 | fn foo<T: Debug>(_: T) -> Self::Item; | |
9 | } | |
10 | ||
11 | #[derive(Debug)] | |
12 | pub struct S<T>(std::marker::PhantomData<T>); | |
13 | ||
14 | pub struct S2; | |
15 | ||
16 | impl Foo for S2 { | |
17 | type Item = impl Debug; | |
18 | ||
19 | fn foo<T: Debug>(_: T) -> Self::Item { | |
416331ca | 20 | S::<T>(Default::default()) |
5e7ed085 | 21 | //~^ Error type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias |
416331ca XL |
22 | } |
23 | } | |
24 | ||
25 | fn main() { | |
26 | S2::foo(123); | |
27 | } |