1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Some cases with closures that might be problems
16 // Should have one error per assignment
18 fn one_closure(x: i32) {
25 fn two_closures(x: i32) {
36 fn fn_ref<F: Fn()>(f: F) -> F { f }
38 fn two_closures_ref_mut(mut x: i32) {
48 // This still gives two messages, but it requires two things to be fixed.
49 fn two_closures_ref(x: i32) {
59 fn two_closures_two_refs(x: &mut i32) {