summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/impl_trait_for_tait_bound.rs
blob: 8ec20acef4de6df8d6dd4d34e7d089c58b341d5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![feature(type_alias_impl_trait)]

use std::fmt::Debug;

type Foo = impl Debug;
pub trait Yay { }
impl Yay for Foo { }

fn foo() {
    is_yay::<u32>();   //~ ERROR: the trait bound `u32: Yay` is not satisfied
    is_debug::<u32>(); // OK
    is_yay::<Foo>();   // OK
    is_debug::<Foo>(); // OK
}

fn is_yay<T: Yay>() { }
fn is_debug<T: Debug>() { }

fn main() {}