summary refs log tree commit diff
path: root/src/test/ui/impl-trait/issues/issue-87295.rs
blob: 2f2bfe147bd6659df0a31072ea42e857e045f54c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
trait Trait {
    type Output;
}
impl Trait for () {
    type Output = i32;
}

struct Struct<F>(F);
impl<F> Struct<F> {
    pub fn new(_: F) -> Self {
        todo!()
    }
}

fn main() {
    let _do_not_waste: Struct<impl Trait<Output = i32>> = Struct::new(());
    //~^ `impl Trait` not allowed outside of function and method return types
}