]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/issue-53598.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / issue-53598.rs
CommitLineData
94222f64 1#![feature(type_alias_impl_trait)]
416331ca
XL
2
3use std::fmt::Debug;
4
5pub trait Foo {
6 type Item: Debug;
7
8 fn foo<T: Debug>(_: T) -> Self::Item;
9}
10
11#[derive(Debug)]
12pub struct S<T>(std::marker::PhantomData<T>);
13
14pub struct S2;
15
16impl Foo for S2 {
17 type Item = impl Debug;
18
19 fn foo<T: Debug>(_: T) -> Self::Item {
416331ca 20 S::<T>(Default::default())
ee023bcb 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
25fn main() {
26 S2::foo(123);
27}