]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/closure-wrong-kind.rs
Fix unused 'mut' warning for capture's root variable
[rust.git] / src / test / ui / closures / closure-wrong-kind.rs
1 /* Any copyright is dedicated to the Public Domain.
2  * http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 struct X;
5 fn foo<T>(_: T) {}
6 fn bar<T: Fn(u32)>(_: T) {}
7
8 fn main() {
9     let x = X;
10     let closure = |_| foo(x);  //~ ERROR E0525
11     bar(closure);
12 }