]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-53598.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / type-alias-impl-trait / issue-53598.rs
1 // ignore-tidy-linelength
2 // ignore-compare-mode-chalk
3 #![feature(type_alias_impl_trait)]
4
5 use std::fmt::Debug;
6
7 pub trait Foo {
8     type Item: Debug;
9
10     fn foo<T: Debug>(_: T) -> Self::Item;
11 }
12
13 #[derive(Debug)]
14 pub struct S<T>(std::marker::PhantomData<T>);
15
16 pub struct S2;
17
18 impl Foo for S2 {
19     type Item = impl Debug;
20
21     fn foo<T: Debug>(_: T) -> Self::Item {
22     //~^ Error type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
23         S::<T>(Default::default())
24     }
25 }
26
27 fn main() {
28     S2::foo(123);
29 }