]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-53598.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / issue-53598.rs
1 #![feature(type_alias_impl_trait)]
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 {
20         S::<T>(Default::default())
21         //~^ Error type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
22     }
23 }
24
25 fn main() {
26     S2::foo(123);
27 }