summary refs log tree commit diff
path: root/src/test/ui/impl-trait/bindings.rs
blob: 899303646d671fd44b57dee425a68960ec71b0bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#![feature(impl_trait_in_bindings)]

fn a<T: Clone>(x: T) {
    const foo: impl Clone = x;
//~^ ERROR can't capture dynamic environment in a fn item
}

fn b<T: Clone>(x: T) {
    let _ = move || {
        const foo: impl Clone = x;
//~^ ERROR can't capture dynamic environment in a fn item
    };
}

trait Foo<T: Clone> {
    fn a(x: T) {
        const foo: impl Clone = x;
//~^ ERROR can't capture dynamic environment in a fn item
    }
}

impl<T: Clone> Foo<T> for i32 {
    fn a(x: T) {
        const foo: impl Clone = x;
//~^ ERROR can't capture dynamic environment in a fn item
    }
}

fn main() { }